Galactic.FileSystem
A utility class for manipulating directories on the file system.
Valid access rights that may be applied to directories.
Create files/write data.
Full control.
List folder/read data.
Modify.
Read.
Read attributes.
Read extended attributes.
Read permissions.
Traverse folder / execute file permissions.
Adds an access rule to the directory at the supplied path.
The path to the directory to add the rule to.
The DirectorySecurity object of the directory that will be changed.
The rule to add to the directory.
Indicates whether changes should be commited to this directory. Useful when combining multiple commands.
True if the rule was added. False if the directory does not exist, the rule is null, or the process does not have access to
the specified path, or does not have sufficient access to change the ACL entry of the directory, or the operating system is not Windows
2000 or later.
Blocks inheritance on this directory.
The path to the directory to block inheritance on.
The DirectorySecurity object of the directory that will be changed.
If true, copies the directory's inherited permissions as explicit permissions on the directory.
Indicates whether changes should be commited to this entry. Useful when combining multiple commands.
True if inheritance was blocked on the directory, false if the directory does not exist, or inheritance could not be
blocked.
Clones a directory to a new location. Does not copy any files or folders beneath it.
The path of the directory to clone.
The destination path to clone the directory to.
True if the directory was cloned. False otherwise.
Commits any pending changes to the directory specified by the supplied path.
The path to the directory to commit changes on.
The DirectorySecurity object of the directory that will be changed.
True if the changes were commited. False if the directory does not exist,
or the current process does not have sufficient access to the specified path, or the
current operating system in not Windows 2000 or later.
Copies a directory to a new location including all files and folders beneath it.
Creates a new directory if necessary.
The path of the directory to copy.
The destination path to copy the directory to.
Whether to overwrite any existing files in the directory being copied to.
True if the directory was copied. False otherwise.
Creates a directory at the specified path.
The path of the directory to create.
True if the directory was created or already exists.
False if an error occured and the directory could not be created.
Deletes a directory at the specified path.
The path of the directory to delete.
Recursively delete the files an subfolders of the directory.
True if the directory was deleted or did not exist, false if an error occured
and the directory could not be deleted.
Checks whether the directory at the specified path exists on the file system.
The path to the directory to check.
True if it exists, false otherwise.
Gets a list of the contents of a directory at the specified path.
The path of the directory to get a list of the contents of.
Whether to obtain a list of the contents of all subdirectories as well.
An array of strings with the names of directories and files under the supplied path.
Null if the path is invalid, does not exist, or the current process does not have permission
to get the directory listing.
Gets the size of a directory's contents in bytes.
The path to the directory.
The size of the directory's contents in bytes, or a negative file size if there was error retrieving this information.
Gets the DirectorySecurity object for the directory specified by the supplied path.
The path to the directory to retrieve the security object for.
The security object for the directory specified. Null if the directory does not exist,
an I/O Error occurred, the current operating system is not Windows 2000 or later,
the path specified is read-only, or the process does not have permission to complete the operation.
Gives access to the account with the supplied security identifier on the target directory.
The security identifier (SID) of the account that should be given access.
The path to the directory to have access granted on.
The DirectorySecurity object of the directory that will be changed.
The access rights to grant on the target directory.
Indicates whether this directory's permissions apply to subfolders beneath it.
Indicates whether this directory's permissions apply to files beneath it.
Indicates whether changes should be commited to this directory. Useful when combining multiple commands.
True if access was granted. False otherwise.
Gives access to the entry supplied on the target directory.
The entry to give access.
The path to the directory to have access granted on.
The DirectorySecurity object of the directory that will be changed.
The access rights to grant on the target directory.
Indicates whether this directory's permissions apply to subfolders beneath it.
Indicates whether this directory's permissions apply to files beneath it.
Indicates whether changes should be commited to this directory. Useful when combining multiple commands.
True if access was granted. False otherwise.
Gives the supplied data access rights to the account with the supplied security identifier on the target directory.
The rights to apply to the target directory.
The security identifier (SID) of the account that should be given access.
The path to the directory to have access granted on.
The DirectorySecurity object of the directory that will be changed.
Indicates whether this directory's permissions apply to subfolders beneath it.
Indicates whether this directory's permissions apply to files beneath it.
Indicates whether changes should be commited to this directory. Useful when combining multiple commands.
True if access was granted. False otherwise.
Gives the supplied data access rights to the entry supplied on the target directory.
The rights to apply to the target directory.
The entry to give data access.
The path to the directory to have access granted on.
The DirectorySecurity object of the directory that will be changed.
Indicates whether this directory's permissions apply to subfolders beneath it.
Indicates whether this directory's permissions apply to files beneath it.
Indicates whether changes should be commited to this directory. Useful when combining multiple commands.
True if access was granted. False otherwise.
Gives the supplied data access rights to the account with the supplied security
identifier on the target directory. Applies inherited permissions to folders and
files beneath the target directory.
The rights to apply to the target directory.
The security identifier (SID) of the account that should be given access.
The path to the directory to have access granted on.
The DirectorySecurity object of the directory that will be changed.
Indicates whether changes should be commited to this directory. Useful when combining multiple commands.
True if access was granted. False otherwise.
Gives the supplied data access rights to the entry supplied on the target directory.
Applies inherited permissions to folders and files beneath the target directory.
The rights to apply to the target directory.
The entry to give data access.
The path to the directory to have access granted on.
The DirectorySecurity object of the directory that will be changed.
Indicates whether changes should be commited to this directory. Useful when combining multiple commands.
True if access was granted. False otherwise.
Moves a directory to a new location.
The path of the directory to move.
The path to the new location to move the directory.
True if the directory was moved. False otherwise.
Removes all access rules from the supplied directory.
The path to the directory to remove all access rules from.
The DirectorySecurity object of the directory that will be changed.
Indicates whether changes should be commited to this directory. Useful when combining multiple commands.
True if all rules were removed. False if an error occurred.
Removes all explicit access rules from the supplied directory.
The path to the directory to have access removed on.
The DirectorySecurity object of the directory that will be changed.
Indicates whether changes should be commited to this directory. Useful when combining multiple commands.
True if access was removed. False otherwise.
Sets the owner of a directory.
The path to the directory to have the ownership set on.
The DirectorySecurity object of the directory that will be changed.
The security identifier (SID) of the account that should take ownership of the entry.
Indicates whether changes should be commited to this entry. Useful when combining multiple commands.
True if the ownership could be set. False otherwise.
Sets the owner of a directory.
The path to the directory to have the ownership set on.
The DirectorySecurity object of the directory that will be changed.
The directy entry that should take ownership of the entry.
Indicates whether changes should be commited to this entry. Useful when combining multiple commands.
True if the ownership could be set. False otherwise.
A utility class for manipulating files on the file system.
The path to the file on the file system.
Whether the file is opened as read-only.
The FileSecurity object for this file.
Creates or opens a file at the supplied path location.
The path to the location to create or open the file at.
Whether to overwrite the contents of an existing file.
Whether the file should be opened as read-only.
Thrown if the caller does not have the required permissions to create or open the file,
or the file is read-only.
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.
Thrown if the specified path is invalid (for example, it is on an unmapped drive).
Thrown if an I/O error occurred while creating the file.
Thrown if opening an existing file and it could not be found at the specified path.
Thrown if the path is in an invalid format.
Thrown if the path was not supplied.
Closes this file.
Copies a file to a new location.
The path of the file to move.
The destination path to copy the file to.
Whether to overwrite the contents of a file if it already exists.
True if the file was copied. False otherwise.
Creates or overwrites a file at the supplied path location.
The path to the location to create the file at.
A FileStream of the file created or null if an error occurred.
Creates or overwrites a file at the supplied path location.
The path to the location to create the file at.
Whether to throw exceptions during file creation / opening.
A FileStream of the file created or null if an error occurred.
Thrown if the caller does not have the required permissions to create or open the file,
or the file is read-only.
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.
Thrown if the specified path is invalid (for example, it is on an unmapped drive).
Thrown if an I/O error occurred while creating the file.
Thrown if the path is in an invalid format.
Thrown if the path was not supplied.
Deletes this file.
True if the file was deleted, false otherwise.
Deletes the file at the specified path.
The path to the file to delete.
True if the file was deleted, false otherwise.
Frees the resources used by this file.
Checks whether this file exists on the file system.
True if it exists, false otherwise.
Checks whether the file at the specified path exists on the file system.
The path to the file to check.
True if it exists, false otherwise.
Opens and gets a StreamReader for the file at the supplied path.
The path to the file to get a StreamReader for.
A StreamReader for the file.
Gets the FileSecurity object for the file specified by the supplied path.
The path to the file to retrieve the security object for.
The security object for the file specified. Null if the file does not exist,
an I/O error occurred, or the process does not have the permissions required to
complete the operation.
Gets the size of a file in bytes.
The path to the file.
The size of the file in bytes, or a negative file size if there was error retrieving this information.
Moves this file to a new location.
The destination path to move the file to.
True if the file was moved. False otherwise.
Moves a file to a new location.
The path of the file to move.
The destination path to move the file to.
True if the file was moved. False otherwise.
Opens a file at the supplied path location.
The path to the location to open the file at.
Whether to open the file as read-only.
A FileStream of the file created or null if an error occurred.
Opens a file at the supplied path location.
The path to the location to open the file at.
Whether to open the file as read-only.
Whether to throw exceptions while opening.
A FileStream of the file created or null if an error occurred.
Thrown if the caller does not have the required permissions to create or open the file,
or the file is read-only.
Thrown if a file could not be found to open at the specified path.
Thrown if the path was not supplied.
Reads the entire contents of this text file, and returns it as a string.
The contents of this text file as a string, null if it could not be read or there
was an error while reading.
Reads the entire contents of a text file, and returns it as a string.
The path to the file to read.
The contents of the text file as a string, null if it could not be read or there
was an error while reading.
Reads the entire contents of a text file, and returns it as a string.
The file stream to read from.
The text read, null if an error occurred while reading.
Reads a line of text from this file.
The line of text read, null if an error occurred while reading.
Reads a line of text from a file's stream.
The file stream to read from.
A stream reader used when reading from the file. Useful for successive calls to ReadLine.
The line of text read, null if an error occurred while reading.
Removes all explicit access rules from this file.
Indicates whether changes should be commited to this file. Useful when combining multiple commands.
True if access was removed. False otherwise.
Removes all explicit access rules from the supplied file.
The path to the file to have access removed on.
The FileSecurity object of the file once changed.
Indicates whether changes should be commited to this file. Useful when combining multiple commands.
True if access was removed. False otherwise.
Writes a line of text to the file.
The line of text to write.
True if the line was written, false otherwise.
Writes a line of text to the specified file stream.
The file stream to write to.
The line of text to write.
True if the line was written, false otherwise.