Rebex
Products Downloads Buy Support Contact
Show / Hide Table of Contents

VDirectoryInfo Class

Namespace: Rebex.IO
Assembly: Rebex.FileSystem.dll (version 7.0.9119)

Class represents a directory in the virtual file system. This class provides properties and methods that are functionally similar to the standard .NET DirectoryInfo properties and methods.

Syntax
public sealed class VDirectoryInfo : VFileSystemInfo
Inheritance
Object
VFileSystemInfo
VDirectoryInfo
Inherited Members
VFileSystemInfo.Attributes
VFileSystemInfo.CreationTime
VFileSystemInfo.CreationTimeUtc
VFileSystemInfo.Exists
VFileSystemInfo.Extension
VFileSystemInfo.FullName
VFileSystemInfo.FullPath
VFileSystemInfo.LastAccessTime
VFileSystemInfo.LastAccessTimeUtc
VFileSystemInfo.LastWriteTime
VFileSystemInfo.LastWriteTimeUtc
VFileSystemInfo.Name
VFileSystemInfo.OriginalPath
VFileSystemInfo.Refresh()
VFileSystemInfo.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Examples
//Create a built-in or custom VFS provider 
var memoryProvider = new MemoryFileSystemProvider()
//Save the root path
var memoryProviderRootPath = memoryProvider.GetRootVDirectoryInfo().FullName;
//Create new directory 'Data' in the root directory
VDirectoryInfo dataDirInfo = new VDirectoryInfo(Path.Combine(memoryProviderRootPath, "Data"));
dataDirInfo.Create();

Constructors

Name Description
VDirectoryInfo(String)

Initializes a new instance of the VDirectoryInfo

Fields

Name Description
FullPath

Full path of the node. Inherited from VFileSystemInfo.

OriginalPath

Original path of the node. This path contains only '/' separator even in case a user provides an original path with '' separator. Inherited from VFileSystemInfo.

Properties

Name Description
Attributes

Gets or sets the attributes for the file or directory. Inherited from VFileSystemInfo.

CreationTime

Gets or sets the creation date and time for the file or directory. Inherited from VFileSystemInfo.

CreationTimeUtc

Gets or sets the creation date and time for the file or directory. The time is expressed in the UTC format. Inherited from VFileSystemInfo.

Exists

Method returns true when the file or directory exists; otherwise returns false. Inherited from VFileSystemInfo.

Extension

Gets the extension of the file. Inherited from VFileSystemInfo.

FullName

Gets the full path of the file. Inherited from VFileSystemInfo.

LastAccessTime

Gets or sets the last access date and time for the file or directory. Inherited from VFileSystemInfo.

LastAccessTimeUtc

Gets or sets the last access date and time for the file or directory. The time is expressed in the UTC format. Inherited from VFileSystemInfo.

LastWriteTime

Gets or sets the last write date and time for the file or directory. Inherited from VFileSystemInfo.

LastWriteTimeUtc

Gets or sets the last write date and time for the file or directory. The time is expressed in the UTC format. Inherited from VFileSystemInfo.

Name

Gets the name of the file or directory. Inherited from VFileSystemInfo.

Parent

Gets an instance of the VDirectoryInfo class that represents the parent of this directory. When this directory represents a root directory then returns null.

Root

Gets an instance of the VDirectoryInfo that represents the root directory.

Methods

Name Description
Create()

Method creates a directory. Any non-existent parent directory is created as well.

CreateSubdirectory(String)

Method creates a subdirectory for the specified path. Any non-existent parent directory is created as well.

Delete()

Deletes a directory.

Delete(Boolean)

Deletes a directory.

EnumerateDirectories()

Returns an enumerator that yields instances of the VDirectoryInfo that are located in a directory.

EnumerateDirectories(String)

Returns an enumerator that yields instances of the VDirectoryInfo that are located in a directory.

EnumerateDirectories(String, SearchOption)

Returns an enumerator that yields instances of the VDirectoryInfo that are located in a directory and their name matches the given searchPattern. When the searchPattern has value AllDirectories then this method returns all subdirectories recursively; otherwise returns only directories on the first level of the hierarchy.

EnumerateFiles()

Returns an enumerator that yields instances of the VFileInfo that are located in a directory.

EnumerateFiles(String)

Returns an enumerator that yields instances of the VFileInfo that are located in a directory and their name matches the given searchPattern.

EnumerateFiles(String, SearchOption)

Returns an enumerator that yields instances of the VFileInfo that are located in a directory and their name matches the given searchPattern. When the searchPattern has value AllDirectories then this method returns all files recursively; otherwise returns only files on the first level of the hierarchy.

EnumerateFileSystemInfos()

Returns an enumerator that yields instances of the VFileSystemInfo that are located in a directory.

EnumerateFileSystemInfos(String)

Returns an enumerator that yields instances of the VFileSystemInfo that are located in a directory and their name matches the given searchPattern.

EnumerateFileSystemInfos(String, SearchOption)

Returns an enumerator that yields instances of the VFileSystemInfo that are located in a directory and their name matches the given searchPattern. When the searchPattern has value AllDirectories then this method returns all file system entries recursively; otherwise returns only file system entries on the first level of the hierarchy.

GetDirectories()

Returns an array that contains instances of the VDirectoryInfo that are located in a directory.

GetDirectories(String)

Returns an array that contains instances of the VDirectoryInfo that are located in a directory and their name matches the given searchPattern.

GetDirectories(String, SearchOption)

Returns an array that contains instances of the VDirectoryInfo that are located in a directory and their name matches the given searchPattern. When the searchPattern has value AllDirectories then this method returns all subdirectories recursively; otherwise returns only directories on the first level of the hierarchy.

GetFiles()

Returns an array that contains instances of the VFileInfo that are located in a directory.

GetFiles(String)

Returns an array that contains full paths to files that are located in a directory and their name matches the given searchPattern.

GetFiles(String, SearchOption)

Returns an array that contains instances of the VFileInfo that are located in a directory and their name matches the given searchPattern. When the searchPattern has value AllDirectories then this method returns all files recursively; otherwise returns only files on the first level of the hierarchy.

GetFileSystemInfos()

Returns an array that contains instances of the VFileSystemInfo that are located in a directory.

GetFileSystemInfos(String)

Returns an array that contains full paths to instances of the VFileSystemInfo that are located in a directory and their name matches the given searchPattern.

GetFileSystemInfos(String, SearchOption)

Returns an array that contains instances of the VFileSystemInfo that are located in a directory and their name matches the given searchPattern. When the searchPattern has value AllDirectories then this method returns all file system entries recursively; otherwise returns only file system entries on the first level of the hierarchy.

MoveTo(String)

Method moves a directory to the location denoted by the destDirName.

Refresh()

Method tries to refresh values of properties in this instance. Inherited from VFileSystemInfo.

ToString()

Method returns the full path of the directory or file. Inherited from VFileSystemInfo.

Extension Methods

VDirectoryInfoExtensions.AsDirectoryNode(VDirectoryInfo)

See Also

VFileInfo
VDirectory
VFile
MemoryFileSystemProvider
LocalFileSystemProvider
MountCapableFileSystemProvider
ReadWriteFileSystemProvider
ReadOnlyFileSystemProvider
In This Article
© REBEX ČR s.r.o. Back to top
Privacy policy
Manage cookies