FileSystem Class

Represents a file system used to store hierarchical data.

Inheritance Hierarchy

Syntax

public class FileSystem : System.IDisposable

Constructors

Name Description
FileSystem

Initializes a new instance of the FileSystem class.

Methods

Name Description
CopyFileAsync(string sourceName, string targetName, bool overwrite)

Copies the specified file from sourceName to targetName.

CreateDirectoryAsync(string directoryName)

Creates the specified directory if it does not already exist.

DeleteDirectoryAsync(string directoryName, bool recursive)

Deletes the specified directory if it exists.

DeleteFileAsync(string fileName)

Deletes the specified file if it exists.

DirectoryExistsAsync(string directoryName)

Returns a value indicating whether the specified directory exists.

Dispose

Releases resources used by this instance.

Dispose(bool disposing)

Releases resources used by this instance.

FileExistsAsync(string fileName)

Returns a value indicating whether the specified file exists.

GetInfoAsync(string path)

Returns information about the specified file or directory if it exists; otherwise returns null (Nothing in Visual Basic).

ListContentsAsync(string path)

Returns a list of the items contained in the specified directory.

MoveFileAsync(string originalName, string newName)

Moves the specified file.

OpenFileAsync(string fileName, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, bool requireRandomAccess)

Returns a stream backed by the specified file.