FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |


OVERWRITE FILES

Syntax:

[DO NOT] OVERWRITE [ [EXISTING] FILES ]

OVERWRITE CHANGED FILES

OVERWRITE ALL FILES

KEEP EXISTING FILES

Version of FPT:

OVERWRITE EXISTING FILES was implemented in version 2.1 of FPT. OVERWRITE CHANGED FILES and OVERWRITE ALL FILES were added in version 3.4-g.

Function:

Specifies the action to be taken if a name clash occurs between output files written by FPT and existing files in the output directory.

The commands OVERWRITE EXISTING FILES or OVERWRITE CHANGED FILES instruct FPT to overwrite (or on VMS systems to supersede) existing files without warnings. Files are overwritten only if the files have changed. If a makefile is used to build the program, only changed files will have new time and date stamps, and only changed files will therefore be rebuilt. The header information written by FPT is ignored in the file comparison, because this always changes when FPT is re-run.

OVERWRITE ALL FILES instructs FPT to overwrite (or supersede) all files, whether they have changed or not. The complete set of output files then bear the same date stamp and FPT header information. Note that FPT does not empty the output directory before overwriting the files. Files which are not part of the code to be written remain unchanged in the output directory.

DO NOT OVERWRITE EXISTING FILES instructs FPT to rename the output files so as to avoid name clashes. Messages are written to the user's screen and to the listing file to indicate which files have been renamed.

FPT always overwrites a listing, FPL, file if this is present. It also deletes or overwrites the temporary listing file, FPL.FPL, which is used if no valid input file name is encountered.

FPT never overwrites a file which it has already written in the current process. If a name clash occurs between two different output files, FPT renames one of them. This could occur, for example, if two different versions of the same INCLUDE file were referenced in the Fortran code from different directories, e.g.

INCLUDE 'C:\RICE\S_ISL\PRECIP.DAT' : : INCLUDE 'C:\RICE\HOKK\PRECIP.DAT' :

Two different files, both named PREC_DAT.INC might be written. The second is renamed PRE0_DAT.INC.

Name clashes between input and output files may be avoided by redirecting the Fortran output or by reading the input from a different directory. The relevant commands are:

OUTPUT DIRECTORY: <directory>

INPUT DIRECTORY: <directory>

PRIMARY INPUT DIRECTORY: <directory>

INCLUDE INPUT DIRECTORY: <directory>

Name clashes may also be avoided by changing the output file name extensions by the commands:

NEW FILE NAME EXTENSIONS

OUTPUT FILE NAME EXTENSION <string>

PRIMARY OUTPUT FILE NAME EXTENSION <string>

INCLUDE OUTPUT FILE NAME EXTENSION <string>

Where to use this command:

Operating system command line

Yes


Configuration file, config.fsp

Yes


Specification (FSP) files, *.fsp

Yes


Interactively, to FPT> prompt:

Yes


Interactive command files

Yes


Embedded in the Fortran code

Yes


Default:

DO NOT OVERWRITE EXISTING FILES

(Note that defaults may be changed in the configuration file)

Example:

! TR2.FSP - Specification file for tr2
tr2.f
terr.f
wind.f
%keep_file_extensions     ! Keep the .f for F77 compiler
%output directory 'fpt'   ! and write to a new directory
%overwrite existing files ! overwriting anything already there

See also:

INPUT DIRECTORY

PRIMARY INPUT DIRECTORY

INCLUDE INPUT DIRECTORY

OUTPUT FILE NAME EXTENSION

PRIMARY OUTPUT FILE NAME EXTENSION

INCLUDE OUTPUT FILE NAME EXTENSION

OUTPUT DIRECTORY


Copyright ©1995 to 2014 Software Validation Ltd. All rights reserved.