GetFileInfo

Returns a FileInfo object for the specified file.


Syntax

FileSystem.FileInfo(File)


Parameters


File

String, input



Name and path of the file.


Remarks


FileInfo Properties



Attributes (FileAttributes)

Gets or sets the attributes for the current file or directory.


CreationTime (Date)

Gets or sets the creation time of the current file or directory.


CreationTimeUtc (Date)

Gets or sets the creation time, in coordinated universal time (UTC), of the current file or directory


Directory (DirectoryInfo)

Gets an instance of the parent directory.


DirectoryName (String)

Gets a string representing the directory's full path.


Exists (Boolean)

Gets a value indicating whether the directory exists.


Extension (String)

Gets the string representation of the extension part of a file.


FullName (String)

Gets the full path of the directory.


IsReadOnly (Boolean)

Gets or sets a value that determines if the current file is read only.


LastAccessTime (Date)

Gets or sets the time the current file or directory was last accessed.


LastAccessTimeUtc

Gets or sets the time, in coordinated universal time (UTC), that the current file or directory was last accessed.


LastWriteTime (Date)

Gets or sets the time when the current file or directory was last written to.


LastWriteTimeUtc (Date)

Gets or sets the time, in coordinated universal time (UTC), when the current file or directory was last written to.


Length (Integer)

Gets the size, in bytes, of the current file.


Name (String)

Gets the name of this DirectoryInfo instance.


Example

This example retrieves a FileInfo object for the specified file and uses it to report the file's full name, last access time and length:


Sub Main()

information = GetFileInfo(SpecialDirectories.MyDocuments & "\FlexSoftware\Flex Terminal Emulator\Flex.aha")

MsgBox "The length is " & information.Length & "."

MsgBox "The file's full name is " & information.FullName & "."

MsgBox "Last access time is " & information.LastAccessTime & "."

End Sub