-------------------------------------------------------------------------------- MODULE IMEND
-------------------------------------------------------------------------------- REPLACES DAMP modules MIF and IFT
--------------------------------------------------------------------------------
IMEND is used to recover IFF files which have been improperly closed as a result of system failure or operator error.
--------------------------------------------------------------------------------
$ IMEND file-spec Command qualifiers Defaults /[NO]RANGE /NORANGE /[NO]TRUNCATE Truncate file after last complete feature.
_IFF file: IFF-file-spec
--------------------------------------------------------------------------------
IFF-file-spec
- specifies the IFF file to be mended. Any part of the file-spec which is not supplied will be taken from the default specification 'LSL$IF:IFF.IFF'.
/RANGE
/NORANGE (default)
- by default IMEND does not update the RA (RAnge) entry after mending the file. The /RANGE qualifier causes IMEND to do a second pass through the IFF file after successful mending. The string (ST,ZS,CB) entries are read and the file (x,y) coordinate range is calculated. The range entry is then updated.
/TRUNCATE
- by default IMEND truncates the IFF file after the last complete map, layer, or feature (EM, EO, or EF entry) found. It then adds EF, EO, EM, and EJ entries as required to correctly terminate the file.
If /NOTRUNCATE is specified (or the file contains no complete map, layer, or feature) then the file is ended after the last complete entry and no extra entries are added.
If an IFF file has been opened for write (or update) and the IFF library is
unable to properly close the file then the file may be corrupt. Unclosed
files may be caused by system crash, operator error (using
The particular problems which may occur when a file has been improperly
closed (and which IMEND attempts to rectify) are as follows:
The action taken by IMEND in attempting to repair an IFF file is as
follows:
After running IMEND the IFF data may subsequently be accessed as
usual (but note that some features at the end of the file may have been lost).
In particular digitising may be resumed with LASERTRAK using the Laseraid OLD
option.
However, note that the recovery of a corrupt IFF file cannot be guaranteed
and any file mended with IMEND should be treated with caution.
$ IMEND TST<CR> %LSLLIB-I-IFFOPENED, IFF file DUA3:[BUREAU.TRIALS]TST.IFF;0 opened for mend %IMEND-I-ENDLAY, end of layer 2 %IMEND-I-ENDLAY, end of layer 32 %IFF-E-IFFERR, IFF error BW on LUN 1 %IMEND-I-CORRUPT, file corrupt in map 1 %IMEND-I-LSTFTR, last complete feature FSN 9996 (9970) layer 32 map 1 %IMEND-S-IFILREP, IFF file successfully mended ELAPSED: 0 00:00:02.33 CPU: 0:00:00.71 BUFIO: 7 DIRIO: 37 FAULTS: 88 $
The IFF error BW is produced by the IFF library, and is one of the IFF errors possible when IMEND reaches the end of sound data and attempts to read corrupted data. It is quite normal for IMEND to produce error messages such as this. IMEND will have truncated the IFF file after feature FSN 9996 (9970) and will have terminated the file with an EO, EM, EJ sequence of IFF entries. All data in the file which was located after feature FSN 9996 (9970) will have been lost. The file should now be available for use, but there can be no guarantee that it is completely sanitary. $STATUS will be set to SS$_NORMAL.
$ IMEND<CR> _IFF file: GHASTLY.MER/RANGE<CR> %LSLLIB-I-IFFOPENED, IFF file DUA0:[LSL.IFF]GHASTLY.MER;0 opened for mend %IMEND-I-ENDLAY, end of layer 0 %IMEND-I-ENDLAY, end of layer 1 %IMEND-I-ENDMAP, end of map 1 %IMEND-I-LSTFTR, last complete feature FSN 1956 (1956), layer 1, map 1 %IMEND-S-IFILREP, IFF file successfully mended %IMEND-I-UPRANGE, updating range entry %IMEND-I-NEWRANGE, new range entry - XMIN 230.300, XMAX 450.874, YMIN 0.003, YMAX 597.839 ELAPSED: 0 00:00:30.52 CPU: 0:00:00.73 BUFIO: 7 DIRIO: 28 FAULTS: 74 $
As the /RANGE qualifier was specified, IMEND has performed a second pass through the IFF file to calculate the (x,y) coordinate range. This is patched into the file RA (RAnge) entry. The calculated range is indicated.
The file should now be available for use, but there can be no guarantee that it is completely sanitary. $STATUS will be set to SS$_NORMAL.
$ IMEND PERDU.IFF<CR> %LSLLIB-E-IFFMODIFY, error opening IFF file DUA3:[BUREAU.TRIALS]PERDU.IFF;0 for update %IFF-E-IFFERR, IFF error USER on LUN 0 -RMS-E-FNF, file not found ELAPSED: 0 00:00:18.39 CPU: 0:00:00.34 BUFIO: 4 DIRIO: 9 FAULTS: 42 $
$ IMEND RUINED.IFF<CR> %LSLLIB-E-IFFMODIFY, error opening IFF file DUA3:[BUREAU.TRIALS]RUINED.IFF;0 for update %IFF-E-IFFERR, IFF error READ on LUN 0 -RMS-E-EOF, end of file detected ELAPSED: 0 00:00:01.39 CPU: 0:00:00.12 BUFIO: 4 DIRIO: 9 FAULTS: 11 $
$ IMEND SADNESS.IFF<CR> %LSLLIB-I-IFFOPNED, IFF file DUA0:[LSL.IFF]SADNESS.IFF; opened for mend %IMEND-I-IFFEMPTY, IFF file is empty ELAPSED: 0 00:00:01.39 CPU: 0:00:00.12 BUFIO: 4 DIRIO: 9 FAULTS: 11 $
$ IMEND DEMO/NOTRUNCATE<CR> %LSLLIB-I-IFFOPENED, IFF file DUA3:[BUREAU.TRIALS]DEMO.IFF;0 opened for mend %IMEND-I-ENALAY, end of layer 1 %IMEND-I-CORRUPT, file corrupt in feature with FSN 7 (7), layer 2, map 1 %IMEND-I-LSTFTR, last complete feature FSN 1 (1), Layer 2, Map 1 %IMEND-I-TERM, file has been terminated after the last complete entry %IMEND-I-IFILREP, IFF file successfully mended ELAPSED: 0 00:00:05.32 CPU: 0:00:00.54 BUFIO: 8 DIRIO: 17 FAULTS: 104 $
--------------------------------------------------------------------------------
These messages give information only, and require no immediate action by the user.
Explanation: Corruption of the IFF file structure has been detected within a map, layer, or feature. The file will be terminated at the last complete map, layer, or feature (or entry if /NOTRUNCATE was used). If this message does not occur, then it is likely that no data has been lost.
User action: None.
ENDMAP, end of map 'integer'
ENDLAY, end of layer 'integer'
Explanation: The end of the given map or layer has been reached. It is safe to assume that the data before this point is safe (but note that the same layer may occur several times if the layer has become fragmented).
User action: None.
FIXEOP, EO pointer amended in layer 'integer'
Explanation: The pointer to the end of this layer contained within the NO entry has been found to be incorrect. It has been corrected.
User action: None. But if this happens repeatedly, then the program responsible may have a bug which requires fixing.
IFILREP, IFF file successfully mended
Explanation: All is well. IMEND has recovered at least some, if not all of the IFF file.
User action: The IFF file may be used with caution.
IFFEMPTY, IFF file is empty
Explanation: There is no hope for the recovery of this file, it contains no entries at all.
User action: None.
LSTFTR, last complete feature FSN 'integer' ('integer'), layer 'integer', map 'integer'
Explanation: This is the last complete feature in the mended file. If this message is not output, then there were no complete features.
User action: None.
NEWRANGE, new range entry - XMIN 'real', XMAX 'real', YMIN 'real', YMAX 'real'
Explanation: IMEND indicates the new range values calculated from the string (ST,ZS,CB) entries present in the file after mending.
User action: Check that the calculated range is what you expected to have in the file.
NOSTS, file contains no ST entries - range entry will not be changed
Explanation: After mending, the file contains no ST entries. The RA (RAnge) entry will not be changed.
User action: None.
TERM, file has been terminated after last complete entry
Explanation: Either /NOTRUNCATE was used, or the file contained no complete maps, layers, or features. The file now ends after the last complete entry. No attempt has been made to add EF, EO, EM, or EJ entries.
User action: None.
UPRANGE, updating range entry
Explanation: You have specified the /RANGE qualifier. This causes IMEND to do a second pass through the IFF file after successful mending. The string (ST,ZS,CB) entries are read and the file (x,y) coordinate range is calculated. The range entry is then updated.
User action: None.
--------------------------------------------------------------------------------
These messages indicate an error in processing which has caused the program to terminate. The most likely causes are a corrupt or otherwise invalid input IFF file, or an error related to command line processing and file manipulation.
NORANGE, file has no range entry
Explanation: IMEND has failed to find the RA (RAnge) entry at the start of the IFF file. It is therefore unable to patch in the calculated (x,y) coordinate range.
User action: Without a range entry, the file is useless. Use ITOTEXT to convert the file into a textual representation. Use a text editor (like VMS EDIT or TPU) to add a range entry. Use IFROMTEXT to convert the text back to an IFF file. Re-run IMEND/RANGE to correctly update the range entry that you created.
In addition to the above messages which are generated by IMEND itself, other messages may be produced by the command line interpreter (CLI) and by Laser-Scan libraries. In particular, messages may be generated by the IFF library. These are introduced by '%IFF' and are documented in the IFF library users' guide. It is quite normal for IMEND to produce an IFF error message when corrupt data is encountered - it will terminate the file at this point. If the cause of an error cannot be traced by the user and Laser-Scan are consulted, then the input file should be preserved to facilitate diagnosis.