Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))

FileLen Function

Class

Microsoft.VisualBasic.FileSystem

Syntax

Dim result As Long = FileLen(pathName)

pathName (required; String)

The name and path of the file to examine for its length

Description

The FileLen function retrieves the length of a disk file in bytes.

Usage at a Glance

  • pathName can be either an absolute path or a relative path from the current directory.

  • An error occurs if the file does not exist.

  • FileLen returns the length of a file as it was last recorded in the directory's record of files. Changes made to the file while actively open may not be reflected in this number. For files currently being modified by your application, use the LOF function instead.

Version Differences

In Visual Basic 2005, the My.Computer.FileSystem object provides more robust access to file management features.

See Also

LOF Function

Категории