Enumeration
enum OpenOption
public enum OpenOption {
| Append
| Create(Bool)
| CreateOrAppend
| CreateOrTruncate(Bool)
| Open(Bool, Bool)
| Truncate(Bool)
}
Description: Indicates different file opening options.
Append
Append
Description: Constructs an OpenOption instance which specifies that the file system should open an existing file and seek to the end of the file. By default, only the write permission is granted on File created using this option. If you attempt to find a location before the file trailer, FSException is thrown. Any read attempt will fail in which case FSException is thrown. If the file does not exist, FSException is thrown.
Create(Bool)
Create(Bool)
Description: Constructs an OpenOption instance which specifies that the file system should create a new file. The write permission is granted on File created using this option by default. You can specify whether the read permission on File is granted by setting parameters. If the file already exists, FSException is thrown.
CreateOrAppend
CreateOrAppend
Description: Constructs an OpenOption instance which specifies that the file system should open a file (if the file exists). Otherwise, a new file should be created. By default, only the write permission is granted on File created using this option. If you attempt to find a location before the file trailer, FSException is thrown. If the file does not exist, Create is used. Otherwise, Append is used.
CreateOrTruncate(Bool)
CreateOrTruncate(Bool)
Description: Constructs an OpenOption instance which specifies that the file system should create a new file. If the file already exists, it will be overwritten. By default, the write permission is granted on File created using this option. You can specify whether the read permission is granted by setting parameters. If the file does not exist, Create is used. Otherwise, Truncate is used.
Open(Bool, Bool)
Open(Bool, Bool)
Description: Constructs an OpenOption instance which specifies that the file system should open an existing file. The first parameter specifies whether the read permission is granted on the file, and the second parameter specifies whether the write permission is granted on the file. If the file does not exist, FSException is thrown.
Truncate(Bool)
Truncate(Bool)
Description: Constructs an OpenOption instance which specifies that the file system should open an existing file. If the file is already opened, it is truncated to zero bytes. By default, the write permission is granted on File created using this option. You can specify whether the read permission is granted by setting parameters. If the file does not exist, FSException is thrown.