v1.2.1.0
FileInfo

Description

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

Properties

String fileName
 
String name
 
String path
 
String filePath
 
String baseName
 
String fullBaseName
 
String suffix
 
String fullSuffix
 
String absPath
 
String absFilePath
 
String normPath
 
String normFilePath
 
String junctionTarget
 
String linkTarget
 
bool isAbs
 
bool isDir
 
bool isExec
 
bool isFile
 
bool isHidden
 
bool isJunction
 
bool isReadable
 
bool isRelative
 
bool isRoot
 
bool isShortcut
 
bool isSymLink
 
bool isWritable
 
bool exists
 
int size
 
FS::Permissions permissions
 
Date atime
 
Date btime
 
Date ctime
 
Date mtime
 

Public Member Functions

Date fileTime (FS::FileTime time)
 

Property Documentation

◆ fileName

String fileName
readwrite

Returns the name of current file (with suffix), excluding the path.

◆ name

String name
read

Returns the name of current file (with suffix), excluding the path. Same as fileName.

◆ path

String path
read

Returns the current file's path, excluding the file name.

◆ filePath

String filePath
read

Returns the current file name, including the path (which may be absolute or relative).

◆ baseName

String baseName
read

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

String fullBaseName
read

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

String suffix
read

Returns the suffix (extension) of the current file. The suffix consists of all characters in the file after (but not including) the last '.'.

◆ fullSuffix

String fullSuffix
read

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

String absPath
read

Returns the current file's absolute path, excluding the file name.

◆ absFilePath

String absFilePath
read

Returns the current file's absolute path, including the file name (with extension).

◆ normPath

String normPath
read

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

String normFilePath
read

Returns the canonical path including the current file name, i.e. an absolute path without symbolic links or redundant "." or ".." elements.

◆ junctionTarget

String junctionTarget
read

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

String linkTarget
read

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

bool isAbs
read

Returns true if the current file path name is absolute, otherwise returns false if the path is relative.

◆ isDir

bool isDir
read

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

bool isExec
read

Returns true if the current file is executable; otherwise returns false.

◆ isFile

bool isFile
read

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

bool isHidden
read

Returns true if the file system entry this FileInfo refers to is ‘hidden’; otherwise returns false.

◆ isJunction

bool isJunction
read

Returns true if the object points to a junction; otherwise returns false. Junctions only exist on Windows NTFS file systems.

◆ isReadable

bool isReadable
read

Returns true if the user can read the file system entry this FileInfo refers to; otherwise returns false.

◆ isRelative

bool isRelative
read

Returns true if the file system entry's path is relative; otherwise returns false.

◆ isRoot

bool isRoot
read

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

bool isShortcut
read

Returns true if the object points to a shortcut; otherwise returns false. Shortcuts only exist on Windows.

◆ isSymLink

bool isSymLink
read

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

bool isWritable
read

Returns true if the user can write to the file system entry, false otherwise.

◆ exists

bool exists
read

Returns true if the current file system entry this FileInfo refers to exists, false otherwise.

◆ size

int size
read

Size of the current file, in bytes.

◆ permissions

FS::Permissions permissions
read

Returns the complete OR-ed together combination of FS.Permissions for the file.

See also
setPermissions()

◆ atime

Date atime
read

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

Date btime
read

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

Date ctime
read

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

Date mtime
read

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).

Member Function Documentation

◆ fileTime()

Date fileTime ( FS::FileTime  time)

Returns the file time specified by time. If the time cannot be determined this function returns an invalid Date object.

See also
atime, btime, ctime, mtime, FS.FileTime