FileSystemInfo Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Provides the base class for both FileInfo and DirectoryInfo objects.

Namespace:  System.IO
Assembly:  System.IO (in System.IO.dll)

public abstract class FileSystemInfo : MarshalByRefObject

The FileSystemInfo type exposes the following members.

  NameDescription
Protected methodFileSystemInfoInitializes a new instance of the FileSystemInfo class.
Top

  NameDescription
Public propertyAttributesGets or sets the attributes for the current file or directory.
Public propertyCreationTimeGets or sets the creation time of the current file or directory.
Public propertyCreationTimeUtcGets or sets the creation time, in coordinated universal time (UTC), of the current file or directory.
Public propertyExistsGets a value indicating whether the file or directory exists.
Public propertyExtensionGets the string representing the extension part of the file.
Public propertyFullNameGets the full path of the directory or file.
Public propertyLastAccessTimeGets or sets the time the current file or directory was last accessed.
Public propertyLastAccessTimeUtcGets or sets the time, in coordinated universal time (UTC), that the current file or directory was last accessed.
Public propertyLastWriteTimeGets or sets the time when the current file or directory was last written to.
Public propertyLastWriteTimeUtcGets or sets the time, in coordinated universal time (UTC), when the current file or directory was last written to.
Public propertyNameFor files, gets the name of the file. For directories, gets the name of the last directory in the hierarchy if a hierarchy exists. Otherwise, the Name property gets the name of the directory.
Top

  NameDescription
Public methodDeleteDeletes a file or directory.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRefreshRefreshes the state of the object.
Protected methodRefreshIfNullIf information from the native file system has not yet been retrieved, retrieves it.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Protected fieldm_fullPathRepresents the fully qualified path of the directory or file.
Top

The FileSystemInfo class contains methods that are common to file and directory manipulation. A FileSystemInfo object can represent either a file or a directory, thus serving as the basis for FileInfo or DirectoryInfo objects. Use this base class when parsing a lot of files and directories.

A derived class can inherit from FileSystemInfo only if the derived class has the AllAccess permission from the FileIOPermissionAccess enumeration.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: