FileOps.$getfileinfo()

Function groupExecute on clientPlatform(s)
FileOpsNOAll

Syntax

FileOps.$getfileinfo(cPath,iInformation)

Description

Returns a list of file information for the file named cPath.

You specify the information to be returned by passing iInfoFlags as a combination of the kFileOpsInfo... constants listed in the following table. If you omit iInfoFlags, only the name is returned. The returned list contains a column for each kFileOpsInfo... constant you specify. The columns you specify occur in the same order as the table.

Col name info flags constant description

name

kFileOpsInfoName

name of the file

name83

kFileOpsInfoName83

DOS 8.3 name of the file

fullname

kFileOpsInfoFullName

full pathname of the file

readonly

kFileOpsInfoReadOnly

file's read-only status

hidden

kFileOpsInfoHidden

file's hidden status

size

kFileOpsInfoSize

logical size of file

actualsize

kFileOpsInfoActualSize

physical size of file on disk; same as logical size under Windows and Unix

created

kFileOpsInfoCreated

date and time the file was created

modified

kFileOpsInfoModified

date and time the file was modified

creator

kFileOpsInfoCreatorCode

the file's creator under macOS, blank under Windows and Unix

type

kFileOpsInfoTypeCode

the file's type under macOS, the file extension under Windows and Unix

linkedname kFileOpsInfoLinkedName

macOS: the path of the linked file (if any)

Windows: the path of the shortcut target (if any)

Unix: the path of the symbolic link target (if any)

isdirectory kFileOpsInfoIsDirectory if the path specified points to a directory

The function returns an empty list if an error occurs.

Example

Do
 
sys(
(10)
 
Returns 
lPath

# returns the name and path of the current library

 
Do
 
FileOps
.
$getfileinfo
(
lPath
,
kFileOpsInfoName
+
kFileOpsInfoSize
+
kFileOpsInfoCreated
)
 
Returns 
lFileList

# returns the name, size, creation date and time of the current library

 
Do
 
lFileList
.
$redefine
(
lFilename
,
lSize
,
lCreated
)

Do
 
lst(
(
lFileList
,1,
lSize
)
 
Returns 
lSize

# returns the value in the size column