VFileInfo Class
Namespace: Rebex.IO
Assembly: Rebex.FileSystem.dll (version 7.0.9147)
Class represents a file in the virtual file system.
This class provides properties and methods that are functionally similar to the standard .NET File
Syntax
public sealed class VFileInfo : VFileSystemInfo
Inherited Members
Examples
//Create a built-in or custom VFS provider
var memoryProvider = new MemoryFileSystemProvider()
//Save the root path
var memoryProviderRootPath = memoryProvider.GetRootVDirectoryInfo().FullName;
//Create a path to the new 'myFile.txt' file.
var myFileTxtPath = Path.Combine(memoryProviderRootPath, "myFile.txt");
//Create 'myFile.txt' file and open it for writing
using (var currentTxtFile = new VFileInfo(myFileTxtPath).CreateText())
{
//Write a line to the file.
currentTxtFile.WriteLine("My content");
}
Constructors
Name | Description |
---|---|
VFile |
Initializes a new instance of the VFile |
Fields
Name | Description |
---|---|
Full |
Full path of the node.
Inherited from VFile |
Original |
Original path of the node.
|
Properties
Name | Description |
---|---|
Attributes | Gets or sets the attributes for the file or directory.
Inherited from VFile |
Creation |
Gets or sets the creation date and time for the file or directory.
Inherited from VFile |
Creation |
Gets or sets the creation date and time for the file or directory.
The time is expressed in the UTC format.
Inherited from VFile |
Directory |
Gets the full path of the parent directory of this file. |
Exists | Method returns true when the file or directory exists; otherwise returns false.
Inherited from VFile |
Extension | Gets the extension of the file.
Inherited from VFile |
Full |
Gets the full path of the file.
Inherited from VFile |
Is |
Gets or sets whether this file is read-only. |
Last |
Gets or sets the last access date and time for the file or directory.
Inherited from VFile |
Last |
Gets or sets the last access date and time for the file or directory.
The time is expressed in the UTC format.
Inherited from VFile |
Last |
Gets or sets the last write date and time for the file or directory.
Inherited from VFile |
Last |
Gets or sets the last write date and time for the file or directory.
The time is expressed in the UTC format.
Inherited from VFile |
Length | Gets the length, in bytes, of the file. |
Name | Gets the name of the file or directory.
Inherited from VFile |
VDirectory | Gets an instance of the VDirectory |
Methods
Name | Description |
---|---|
Append |
Method returns an instance of the Stream |
Copy |
Method copies the file to the location denoted by the |
Copy |
Method copies the file to the location denoted by the |
Create() | Method returns read/write instance of the VFile |
Create |
Method returns Stream |
Delete() | Method deletes the file. |
Move |
Method moves the file to the location denoted by the |
Open(File |
Method returns an instance of the VFile |
Open(File |
Method returns an instance of the VFile |
Open(File |
Method returns an instance of the VFile |
Open |
Method returns an instance of the read-only VFile |
Open |
Method returns an instance of the Stream |
Open |
Method returns an instance of the write-only VFile |
Refresh() | Method tries to refresh values of properties in this instance.
Inherited from VFile |
Replace(String, String) | Method copies content of the file to the |
Replace(String, String, Boolean) | Method copies content of the file to the |
To |
Method returns the full path of the directory or file.
Inherited from VFile |