INITFILE Verb - Reinitialize File
Syntax
INITFILE filename{,MODE=string}{,ERR=lineref}
Description
For BBj-specific information, see INITFILE Verb - BBj.
The INITFILE verb erases and recreates a file.
Parameter | Description |
---|---|
filename | Name of the file to be reinitialized. If this parameter refers to a device, is not LOCKable, or otherwise cannot be ERASEd and FILEd, the appropriate error codes are issued. See the note below. |
ERR=lineref | Branch to be taken if an error occurs during execution. |
The UNIX UMASK setting (file-creating mode mask) of the user determines the permissions placed on the file when it is reinitialized.
MODE Options
Mode | Description |
---|---|
CRYPTPASS= | In PRO/5 5.0 and higher, and BBj 4.0 and higher, initializes an encrypted file with the specified password. In order to correctly re-initialize an encrypted file, the correct password must be provided. |
Example
1010 INITFILE F$,ERR=1020; GOTO 2000
1020 ...
Note: The INITFILE verb is equivalent to the following program:
REM INITFILE - Emulate INITFILE verb.
SETERR ERROR
ENTER F$
LET U=UNT
OPEN (U)F$
LET FID$=FID(U),FIN$=FIN(U)
CLOSE (U)
ERASE F$
IF AND(FID$(1,1),$0F$)=$06$ THEN FILE FID$,FIN$(86) ELSE FILE FID$
EXIT
ERROR:
EXIT ERR
END