[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'LazFileUtils' (#lazutils)

GetFileDescription

Gets descriptive information for the specified file name.

Declaration

Source position: lazfileutils.pas line 136

function GetFileDescription(

  const AFilename: string

):string;

Arguments

AFilename

  

File name examined in the function.

Function result

String with the file information for the platform or OS.

Description

GetFileDescription is a String function used to get descriptive information for the file name specified in AFilename. The return value contains file information appropriate to the platform, environment, or file system. The implementation of GetFileDescription and the content of the return value are platform- or OS-specific.

For UNIX-like environments, the return value can contain information that indicates the permissions for the user, group, and owner of the file as returned from the FPStat routine. It also includes the file user and group IDs, file size, and modification timestamp. For example:

ld-rwxrwxrwx Owner: UID.GID Size: 99999 Modified: MM/DD/YYYY hh:nn
l
File is a symbolic link
d
File is a directory in the file system
b,c, or -
Device type for the entry. b is for block-level devices. c is for character devices. All others device types contain the - character.
r or -
User read access permission
w or -
User write access permission
x or -
User executable permission
r or -
Group read access permission
w or -
Group write access permission
x or -
Group executable permission
r or -
Other read access permission
w or -
Other write access permission
x or -
Other executable permission
UID
User identifier number assigned as the owner of the file
GID
Group identifier number assigned to the group which owns the file
99999
Size of the file. May indicate the total number of blocks or characters depending on the device type for the file.
MM/DD/YYYY hh:nn or ?
Creation/modification timestamp for the file. ? is included if an exception is raised when accessing the date/time value.

For the Amiga platform, the content in the return value is derived using a TFileInfoBlock for a shared lock on the file. The return value can be an empty string if the file could not be locked using a shared lock on the file system. It can contain values like the following:

asperwd
a
File is an archived (unchanged) file
s
File is a script or executable file
p
File is command or program that can be made resident
e
File is used by the Shell
r
File is readable
w
File is writable
d
File cannot be deleted

For Windows platforms, the return value contains only the modification date / time for the file using the format:

Modified: MM/DD/YYYY hh:mm

The return value can be 'Modified: ?' if an exception is encountered when getting the date/time value for the file.


Version 3.2 Generated 2024-02-25 Home