Table of Contents

Class FileSystemInfo

Namespace
System.IO
Assembly
System.IO.FileSystem.dll

Provides the base class for both FileInfo and DirectoryInfo objects.

public abstract class FileSystemInfo : MarshalByRefObject
Inheritance
FileSystemInfo
Derived
Inherited Members
Extension Methods

Constructors

FileSystemInfo()

protected FileSystemInfo()

Properties

Attributes

Gets or sets the attributes for the current file or directory.

public FileAttributes Attributes { get; }

Property Value

FileAttributes

Exists

Gets a value indicating whether the file or directory exists.

public abstract bool Exists { get; }

Property Value

bool

Extension

Gets the extension part of the file name, including the leading dot

.
even if it is the entire file name, or an empty string if no extension is present.
public string Extension { get; }

Property Value

string

A string containing the FileSystemInfo extension.

FullName

Gets the full path of the directory or file.

public virtual string FullName { get; }

Property Value

string

Name

Gets the name of the file.

public abstract string Name { get; }

Property Value

string

Methods

Delete()

Deletes a file or directory.

public abstract void Delete()

HandleRefreshError()

Handler for the case when the file or directory does not exist.

protected abstract void HandleRefreshError()

Refresh()

Refreshes the state of the object.

public virtual void Refresh()

Exceptions

IOException

A device such as a disk drive is not ready.