FileLen Function |
No
FileLen(pathname)
Pathname
Use: Required
Data Type: String
The filename, optionally along with its path and drive.
A Long data type containing the length of the specified file in bytes.
Indicates the length of a file.
If you don't specify a drive or folder with filename, the file is assumed to be in the current drive or folder.
Use the Dir function to determine that the file exists before calling File-DateTime. If the file doesn't exist, FileDateTime generates runtime error 53, "File not found." Another method of determining that a file exists before referencing it comes from the new FileSystemObject object in VB6, which includes a FileExists method.
Because FileLen returns the length of a file based on the file allocation table, the value returned by FileLen reflects the size of the file before it was opened. In the case of open files, you should instead use the LOF function to determine the open file's current length.