FileInfo
provides read-only information about a file system object (file or directory). This type cannot be created on its own. You can get an instance via Dir.info()
, File.info()
, FileHandle.info()
, or a directory listing with Dir.infoList()
functions.
- Since
- 1.2.1
◆ fileName
Returns the name of current file (with suffix), excluding the path.
◆ name
Returns the name of current file (with suffix), excluding the path. Same as fileName
.
◆ path
Returns the current file's path, excluding the file name.
◆ filePath
Returns the current file name, including the path (which may be absolute or relative).
◆ baseName
Returns the base name of the current file without the path. The base name consists of all characters in the file up to (but not including) the first '.' character.
◆ fullBaseName
Returns the complete base name of the current file without the path. The full base name consists of all characters in the file up to (but not including) the last '.' character.
◆ suffix
Returns the suffix (extension) of the current file. The suffix consists of all characters in the file after (but not including) the last '.'.
◆ fullSuffix
Returns the "full" suffix (extension) of the current file. The full suffix consists of all characters in the file after (but not including) the first '.'.
◆ absPath
Returns the current file's absolute path, excluding the file name.
◆ absFilePath
Returns the current file's absolute path, including the file name (with extension).
◆ normPath
Returns the current file's path canonical path (excluding the file name), i.e. an absolute path without symbolic links or redundant "." or ".." elements.
◆ normFilePath
Returns the canonical path including the current file name, i.e. an absolute path without symbolic links or redundant "." or ".." elements.
◆ junctionTarget
Returns the absolute path to the directory an NTFS junction points to, or an empty string if the object is not an NTFS junction.
◆ linkTarget
Returns the absolute path to the file or directory a symbolic link points to, or an empty string if the object isn't a symbolic link.
◆ isAbs
Returns true
if the current file path name is absolute, otherwise returns false
if the path is relative.
◆ isDir
Returns true
if this object points to a directory or to a symbolic link to a directory. Returns false
if the object points to something that is not a directory (such as a file) or that does not exist.
◆ isExec
Returns true
if the current file is executable; otherwise returns false
.
◆ isFile
Returns true
if this object points to a file or to a symbolic link to a file. Returns false
if the object points to something that is not a file (such as a directory) or that does not exist.
◆ isHidden
Returns true
if the file system entry this FileInfo
refers to is ‘hidden’; otherwise returns false
.
◆ isJunction
Returns true
if the object points to a junction; otherwise returns false
. Junctions only exist on Windows NTFS file systems.
◆ isReadable
Returns true
if the user can read the file system entry this FileInfo
refers to; otherwise returns false
.
◆ isRelative
Returns true
if the file system entry's path is relative; otherwise returns false
.
◆ isRoot
Returns true
if the object points to a directory or to a symbolic link to a directory, and that directory is the root directory; otherwise returns false
.
◆ isShortcut
Returns true
if the object points to a shortcut; otherwise returns false
. Shortcuts only exist on Windows.
◆ isSymLink
Returns true
if the object points to a symbolic link; otherwise returns false
. Symlinks exist on all Unix-like operating systems and Windows NTFS file systems.
◆ isWritable
Returns true
if the user can write to the file system entry, false
otherwise.
◆ exists
Returns true
if the current file system entry this FileInfo
refers to exists, false
otherwise.
◆ size
Size of the current file, in bytes.
◆ permissions
Returns the complete OR-ed together combination of FS.Permissions
for the file.
- See also
- setPermissions()
◆ atime
Returns the date and local time when the current file was last accessed. If the time cannot be determined, returns an invalid Date object. Same as fileTime(S_ATIME)
.
◆ btime
Returns the date and time when the current file was created / born. If the time cannot be determined, returns an invalid Date object. Same as fileTime(S_BTIME)
.
◆ ctime
Returns the date and time when the file's metadata was last changed. If the time cannot be determined, returns an invalid Date object. Same as fileTime(S_CTIME)
.
◆ mtime
Returns the date and local time when the current file was last modified. If the time cannot be determined, returns an invalid Date object. Same as fileTime(S_MTIME)
.
◆ fileTime()