Initializing help system before first use

# getfstat, getflstat

Purpose
Get the status (type and access mode) of a file or directory.
Synopsis
`function getfstat(filename:string|text):integer`
`function getflstat(filename:string|text):integer`
Argument

filename | Name (and path) of the file or directory to check

Return value
Bit encoded type and mode of the given file or 0 if the file cannot be accessed.
Example
The following determines whether ftest is a directory and if it is writable:

    fstat:= getfstat("ftest")
    if bittest(fstat, SYS_TYP)=SYS_DIR
    then writeln("ftest is a directory")
    end-if
    if bittest(fstat, SYS_WRITE)=SYS_WRITE
    then writeln("ftest is writeable")
    end-if

Further information
1. The returned status type may be decoded using the constant mask SYS_TYP (the types are exclusive). Possible values are:

SYS_DIR | Directory
SYS_REG | Regular file
SYS_LNK | Symbolic link
SYS_OTH | Special file (device, pipe...)

The access mode may be decoded using the constant mask SYS_MOD (the access modes are additive). Possible values are:

SYS_READ | Can be read
SYS_WRITE | Can be modified
SYS_EXEC | Is executable

2. The 2 versions of this function behave the same except for symbolic links: the first one ( getfstat) reports the properties of the linked file while the second ( getflstat) reports a type SYS_LNK.
Related topics
readlink, getsysstat
Module
mmsystem
Parent Topic Procedures and functions

© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.