Click or drag to resize
Galactic API

File Constructor

Creates or opens a file at the supplied path location.

Namespace:  Galactic.FileSystem
Assembly:  Galactic.FileSystem (in Galactic.FileSystem.dll) Version: 1.3.0.499 (1.3.0.499)
Syntax
public File(
	string path,
	bool overwrite,
	bool readOnly = false
)

Parameters

path
Type: SystemString
The path to the location to create or open the file at.
overwrite
Type: SystemBoolean
Whether to overwrite the contents of an existing file.
readOnly (Optional)
Type: SystemBoolean
Whether the file should be opened as read-only.
Exceptions
ExceptionCondition
UnauthorizedAccessExceptionThrown if the caller does not have the required permissions to create or open the file, or the file is read-only.
PathTooLongExceptionThrown if the specified path, file name, or both exceeds the system-defined maximum length. For example, on Windows-based patforms, paths must be less than 248 characters, and file names must be less than 260 characters.
DirectoryNotFoundExceptionThrown if the specified path is invalid (for example, it is on an unmapped drive).
IOExceptionThrown if an I/O error occurred while creating the file.
FileNotFoundExceptionThrown if opening an existing file and it could not be found at the specified path.
NotSupportedExceptionThrown if the path is in an invalid format.
ArgumentNullExceptionThrown if the path was not supplied.
See Also