FileSystem.GetFileInfo Method (String)
Returns a FileInfo object for the specified file.
Assembly: Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
The path name is malformed. For example, it contains invalid characters or is only white space. The file name has a trailing slash mark.
file is Nothing or an empty string.
The path contains a colon in the middle of the string.
The path is too long.
The user lacks necessary permissions.
The user lacks ACL (access control list) access to the file.
An exception is not thrown if the file does not exist; rather, it will be thrown the first time the object's properties are accessed.
The following table lists an example of a task involving the My.Computer.FileSystem.GetFileInfo method.
Determine a file's name and path
This example retrieves a System.IO.FileInfo object for the file MyLogFile.log and uses it to report the file's full name, last access time, and length.
Available since 2.0