When the ‘-F’ option is in effect, FTANGLE writes its output
to a temporary file (or files) instead of to its ultimate
destination such as test.c and/or test.f. After all
output is written, the temporary files are compared with the old version
of the files, if they exist. If the files are identical, the
appropriate temporary file is deleted; otherwise, the temporary file is
renamed, effectively overwriting the old version. This feature avoids
updating the time stamp on the file unnecessarily, so a make
file won’t
recompile the output unless it really has to.
Note that with this option in effect, if one uses the UNIX utility
touch
to force processing of a group of files, but the web
sources are never changed, the make
file will continue to tangle
the sources no matter how many times it is run, since FTANGLE will
never update the time stamp on the files. This is harmless, but
annoying. To get things back in sync, do a run without the ‘-F’.
The location of the temporary file as well as details of the renaming
procedure are determined by the automatic configuration script
./configure
during
installation of the processors. The script first looks for
the (non-ANSI) function tempnam
.
If it finds it, it uses it to place
the temporary file in the directory that FWEB would normally use for
output in the absence of the ‘-F’ option. (That is usually the current
directory.) If tempnam
is not available, the ANSI routine
tmpnam
is used.
That places the temporary file in a directory
determined by the system.
To implement the renaming, the rename
function is used. That may fail
if tmpnam
placed the temporary file on a different device. If so, an
attempt is made to force the rename by using the system
routine to
issue a mv
command. Terminal output indicates the progress of the
renaming. An asterisk following an output file name indicates that
rename
did not succeed, but the mv
command did.
Some of the above-mentioned file names and system commands are system-dependent; see Customization.