The latest version of this file can be found at http://users.erols.com/emmes/emmestech/fileutils-4.0/fileutils.html.
The port of fileutils-4.0 to Cygwin presented very little problem. The only change necessary was adding the commands setmode(source_desc,O_BINARY) and setmode(dest_desc,O_BINARY) in the copy_reg subroutine of copy.c. This causes the file being copied to be read in binary mode and writes the file being written in binary mode so that copying is accurate and not terminated at the first control-Z, which Win32 sadly thinks should be the end-of-file in text mode. If you implement my port using patchfile-1.0, you will see messages each time install, mv, or cp sets filetype to BINARY. The message display has been removed in version 1.1.
I have made one significant change to install (and mv) to compensate for a
problem in the way Cygwin handles standard Unix makefiles. Most Unix makefiles
have things like:
gcc -o prog prog.c
install prog prog-destination
This works fine under real Unix, but under Cygwin and Mingw, the first line produces the executable prog.exe, and not prog. Therefore, under Cygwin, the second line produces the error message "prog not found" and the install fails. With my port of fileutils-4.0, if the shell variable INSTALL_EXE is set, the install will work.
If INSTALL_EXE is set to anything except "silent", you will see the warning "prog not found. prog.exe installed instead".
If INSTALL_EXE is set to "silent", prog.exe will be installed and you will not see a warning.
If INSTALL_EXE is not set, and prog does not exist, you will see the error message "prog not found or not readable" and install will exit.
Setting MV_EXE has a similar effect on the mv command.
In a Bourne shell, shell variable are set with "export MV_EXE=something". In tcsh, this translates to "setenv MV_EXE something".
As stated elsewhere the goal in my ports is to have them install-able with a simple "make install". That may not be possible without this port being installed. There are special instructions for installing this port.
Good luck!