FileInfo

FileInfo


Provides methods for manipulating, setting and retrieving information for the specified file.


Remarks

The existence of the file is not verified until an action that requires accessing the file.

 Dim info As FileInfo
 Set info = NewFileInfo("c:\myfile.txt")
 Debug.Print info.Length
 

See Also

Project VBCorLib Overview | Constructors

Implements:

FileSystemInfo 
IObject 

Public:

Properties:

NameDescription
 Attributes (get)Returns the attributes for the file (ReadOnly, Hidden, ...) 
 Attributes (let)Sets the attributes for the file (ReadOnly, Hiddin, ...) 
 CreationTime (get)Returns the creation time as a cDateTime object. 
 CreationTime (let)Sets the creation time of the file. 
 CreationTime (set)Sets the creation time of the file. 
 CreationTimeUtc (get)Returns the creation time as a UTC time. 
 CreationTimeUtc (let)Sets the creation time of the file in UTC time. 
 CreationTimeUtc (set)Sets the creation time of the file in UTC time. 
 Directory (get)Returns a DirectoryInfo object of the directory portion of the file. 
 DirectoryName (get)Returns the directory portion of the filename. 
 Exists (get)Indicates if the file exists on disk. 
 Extension (get)Returns the extension portion of the filename. 
 FullName (get)Returns a full path to the file, including the filename. 
 LastAccessTime (get)Returns the last time the file was accessed. 
 LastAccessTime (let)Sets the time the file was last accessed. 
 LastAccessTime (set)Sets the time the file was last accessed. 
 LastAccessTimeUtc (get)Returns the time the file was last accessed in UTC time. 
 LastAccessTimeUtc (let)Sets the time the file was last accessed in UTC time. 
 LastAccessTimeUtc (set)Sets the time the file was last accessed in UTC time. 
 LastWriteTime (get)Returns the last time the file was written to. 
 LastWriteTime (let)Sets the last time the file was written to. 
 LastWriteTime (set)Sets the last time the file was written to. 
 LastWriteTimeUtc (get)Returns the last time the file was accessed in UTC time. 
 LastWriteTimeUtc (let)Sets the last the time file was written to in UTC time. 
 LastWriteTimeUtc (set)Sets the last time the file was written to in UTC time. 
 Length (get)Returns the size of the file in bytes. 
 Name (get)Returns the filename portion of the path. 

Methods:

NameDescription
 AppendTextOpens a StreamWriter for the file. 
 CopyToCopies this file to a new location, with optional overwrite. 
 CreateCreates this file and returns a FileStream object to access it. 
 CreateTextReturns a StreamWriter to write to this file. 
 DeleteDeletes this file. 
 EqualsReturns a boolean indicating if the value and this object instance are the same instance. 
 GetHashCodeReturns a pseudo-unique number identifying this instance. 
 MoveToMoves this file to a new location. 
 OpenFileOpens the file as a FileStream. 
 OpenReadReturns a FileStream in ReadOnly mode. 
 OpenTextReturns a StreamReader to this file. 
 OpenWriteReturns a FileStream with write access to the file. 
 RefreshReloads the file attributes and times. 
 ToStringReturns a string representation of this object instance.