FS_Open
Open FS file
FS_Open creates a new FS file or opens an existing one.
Format:
FS_Open context name flags allocation label password clustersize fclustersize
Returns:
Returns a condition code.
Arguments:
context
A pointer to the context value to be returned by FS_Open. The context is not set if the service fails.
name
The address of a SRB structure that points to the full file specification of the FS file to create or open. The name cannot be null. If the file doesn't exist, it is created and a new file system is initialized in it.
flags
The address of an 8-byte integer containing the open flags to use for the FS file.
allocation
The address of an 8-byte integer containing the size of the new file, in bytes, if a new file is being created. Otherwise, it is ignored.
label
The address of an SRB structure that points to a label for the file system. Only used when a new file system is created. It is ignored otherwise.
password
The address of an SRB structure that points to a password for the file system. On creation, it is applied to the file system. For existing file systems, this must match the file system's existing password.
clustersizs
The address of an 8-byte integer containing the default clustersize for files created in the file system, in bytes. It must be a power of 2. Only used when creating a new file system. Ignored otherwise.
fclustersizs
The address of an 8-byte integer containing the default clustersize for folders created in the file system, in bytes. It must be a power of 2. Only used when creating a new file system. Ignored otherwise.
Description
FS_Open can open an existing file containing a file system, or create a new one. When creating a new one, the arguments can be used to define the characteristics of the file system, including default clustersizes, passwords, and so forth. When the caller is finished with the FS file, FS_Close should be called to release the FS file and associated resources.
Condition Codes Returned:
Code |
Meaning |
FS_INVCONT |
Specified context is not valid. |
FS_INVFLAG |
One or more invalid flags were specified. |
FS_INVNAME |
Specified name is not valid. |
SS_NORMAL |
Successful completion. |
Also, any errors that can result from opening or creating the FS file may be returned.