Single File System: Virtual File System Delphi Library
for Archive / Backup with Transparent Compression and Strong Encryption
Opens a specified file within a single file system using a specified access mode.
function FileOpen(const FileName: string; Mode: LongWord; Password: string = ''; Question: string = ''; Answer: string = ''): Integer;
Use FileOpen to open a file and obtain its file handle within a single file system. The access mode value is constructed by OR-ing one of the fmOpen constants with one of the fmShare constants defined in File open mode constants.
The Password parameter value different from default blank string indicates that the data is encrypted by this password. This parameter is required to open an existing encrypted file. If the encrypted file is open and the Password doesn't match the password that was used to encrypt the file then Create raises an exception
The Question parameter indicates a question that may be asked if a user forgot his / her password to recover the password.
The Answer parameter indicates an answer that must be given by a user to recover his/her forgotten password.
If the return value is positive, the function was successful and the value is the file handle of the opened file. A return value of -1 indicates that an error occurred.
Use of the file handlers such as FileOpen is not encouraged. These are low-level file access routines. For normal file operations use TSFSFileStream instead.