fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

Output File Handling

Files Output by fpt

The files output by fpt are:

Directories

The current working directory: The listing (fpl) file, and all non-Fortran text files except the Makefile are written to the current working directory. All Fortran files are also written to this directory if alternative directories are not specified.

Note that if the listing file cannot be opened, for example, because the user does not have write permission to the current working directory, fpt exits immediately with a fatal error.

The primary Fortran output directory: This is specified by the commands: PRIMARY OUTPUT DIRECTORY or OUTPUT DIRECTORY. The Makefile, any new Fortran files, and any primary files copied from the fpt libraries are written here. All of the primary Fortran output files are written here unless they are re-directed by the file name editing commands described below.

The include output directory: This is specified by the commands: INCLUDE OUTPUT DIRECTORY or OUTPUT DIRECTORY. This directory receives the Fortran include files which correspond to the input files unless these have been redirected by the file editing commands. It also receives include files from the fpt libraries and all include files written in response to fpt commands.

Directory names derived from the names of the input directories: These directories are set up by the commands: KEEP OUTPUT DIRECTORIES and EDIT OUTPUT FILE NAMES With these commands it is possible to preserve the directory structure of an application but to copy it to a different area in the file system. Please see the description of Keeping the directory structure.

File Name Extensions

If no commands are made to specify the output file name extensions, fpt writes primary Fortran files with the extension ".fpt" and include files with the extension ".fpi"". This may be changed by the commands:
PRIMARY OUTPUT FILE NAME EXTENSION
INCLUDE OUTPUT FILE NAME EXTENSION
OUTPUT FILE NAME EXTENSION
KEEP FILE NAME EXTENSIONS
EDIT OUTPUT FILE NAMES

Care should be taken to avoid overwriting the input files if the input and output file name extensions are the same.

Note that unless the command KEEP FILE NAME EXTENSIONS is made, fpt uses only one file name extension for primary files and one for include files. This could cause file name conflicts if there are multiple input files with the same base file name but different extensions. For this reason, any file name extension which does not match the default input file name extension is appended to the base file name. Thus, if a project contains the primary files: heli.f, heli.bda and heli.ctrl and the default primary input file name extension is ".f", the corresponding output files will be, for example, heli.f, heli_bda.f and heli_ctrl.f.

Maximum Base File Name Length

Some operating systems impose a maximum length for the base file name (The characters between the directory specification and the extension). In old versions of Unix this can be as small as 40 characters. By default, the maximum base file name length accepted by fpt is 140. A lower limit may be set by the command: MAXIMUM BASE FILE NAME LENGTH File names which exceed this length are renamed as described below.

Overwriting of Files

If the output file name and directory controls cause name collisions between two or more output files, fpt renames the second and subsequent output file(s) affected. The file names in INCLUDE statements are modified to reflect the changes.

If a name collision taked place between an old, existing file in the output directory and a new output file, the behaviour is controlled by the commands:
[DO NOT] OVERWRITE EXISTING FILES
OVERWRITE CHANGED FILES
OVERWRITE ALL FILES
The default behaviour is not to overwrite files, but the defaults these commands are usually set up in the configuration file.

Automatic Renaming of Files

Files are automatically renamed:

When a file is renamed automatically, the base name is truncated, if necessary, to 3 characters less than the length specified by the command MAXIMUM BASE FILE NAME LENGTH. An underscore character followed by a 2 digit number is appended to the base name, and the number is incremented until a unique name is found. If no unique name exists with a two digit number the length of the number is increased.

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