PowerAda afilemv

From OC Systems Wiki!
Jump to: navigation, search


afilemv - renames a compiled source file


afilemv [-hvFS] Sublibrary CurrentFilename NewFilename


This command renames a source file that was compiled into the specified sublibrary. You can use afilemv to enable the Ada tools such as abuild to find source files of Ada programs that have been moved to other locations. You can use the areport command to verify your source file name changes in the sublibrary.

Note that unless you compile with the -P compiler option on the ada command, the source will be saved in the library and the debugger and other GUI tools will get from there, independent of the file path.


Requests help for the command. If specified, all other options and parameters (except possibly erroneous ones) are ignored.
Verbose mode: displays progress messages to standard error.
Requests that the source file name be changed without verifying the existence of the file NewFileName. If this option is not specified, afilemv checks for the existence of NewFileName and asks whether to make the change if it does not exist.
replaces substring CurrentFilename with NewFilename in all filenames, rather than replacing the single CurrentFilename entirely with NewFilename.


Specifies the sublibrary in which the name of the source file is to be changed.
Specifies the name of a source file that is currently recorded in the sublibrary, or, if -S is specified, the substring to be matched in all filenames in the sublibrary.
Specifies the new name for CurrentFileName. The name will be changed in the specified sublibrary. You can specify NewFileName relative to the current directory or as an absolute path name. If -S is specified, this replaces the substring CurrentFilename, so no expansion is done.


Below is a list of the possible values returned by afilemv. Refer to Return Codes for Commands for details about the meaning of these return s.

0, 1, 2, 3, 16, 99


$POWERADA/bin/afilemv - the afilemv program


This must be defined and indicate the powerada/ada95 directory in the PowerAda installation.


The following examples illustrate how you could specify file names to afilemv if you have compiled files named /a/b/c.ada, /a/z/c.ada, and /some/other/file.ada into a sublibrary named adalib. These examples all assume adalib is in your current directory.

1. You could change the name recorded for /a/b/c.ada by issuing either of the following commands:
afilemv adalib /a/b/c.ada /backup/c.ada
afilemv adalib b/c.ada /backup/c.ada
You could not simply specify c.ada as the current file name because two file names in the sublibrary have that base name.
2. You could change the name recorded for some/other/file.ada in the sublibrary by issuing any of the following commands:
afilemv adalib file.ada /checkpoint/file.ada
afilemv adalib file.ada ../../checkpoint/file.ada
afilemv -S adalib some/other /checkpoint
You can specify the current file name as file.ada because no other file name in the sublibrary has the same base name.
You can specify the new file name as either a relative or absolute path name; in this example, /checkpoint and ../../checkpoint must designate the same directory.


abuild, adbg, areport.