FileInfo

FileInfo


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


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, Hidden, ...)  
 CreationTime (get) Returns the creation time as a CorDateTime 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
 AppendText Opens a StreamWriter for the file.  
 CopyTo Copies this file to a new location, with optional overwrite.  
 Create Creates this file and returns a FileStream object to access it.  
 CreateText Returns a StreamWriter to write to this file.  
 Delete Deletes this file.  
 Equals Returns a boolean indicating if the value and this object instance are the same instance.  
 GetHashCode Returns a pseudo-unique number identifying this instance.  
 MoveTo Moves this file to a new location.  
 OpenFile Opens the file as a FileStream.  
 OpenRead Returns a FileStream in ReadOnly mode.  
 OpenText Returns a StreamReader to this file.  
 OpenWrite Returns a FileStream with write access to the file.  
 Refresh Reloads the file attributes and times.  
 ToString Returns a string representation of this object instance.  

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 CorLib Overview

Class FileInfo Overview

Constructors