| 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
)
Public Sub New (
path As String,
overwrite As Boolean,
Optional readOnly As Boolean = false
)
public:
File(
String^ path,
bool overwrite,
bool readOnly = false
)
new :
path : string *
overwrite : bool *
?readOnly : bool
(* Defaults:
let _readOnly = defaultArg readOnly false
*)
-> File
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 Exception | Condition |
---|
UnauthorizedAccessException | Thrown if the caller does not have the required permissions to create or open the file,
or the file is read-only. |
PathTooLongException | Thrown 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. |
DirectoryNotFoundException | Thrown if the specified path is invalid (for example, it is on an unmapped drive). |
IOException | Thrown if an I/O error occurred while creating the file. |
FileNotFoundException | Thrown if opening an existing file and it could not be found at the specified path. |
NotSupportedException | Thrown if the path is in an invalid format. |
ArgumentNullException | Thrown if the path was not supplied. |
See Also