KI_STAT
Argument | Enumeration | Purpose |
---|---|---|
path$ | Pathname | |
SYM(rowbuf$()) | Row buffer or row buffer array | |
status | KDB_ERROR_ENUM | Optional return status |
KI_STAT
This routine retrieves information on the given file. The structure to be returned should be declared as a DEFRECORD of type KCML_FILE_STAT and indexed using the built in fields defined therein.
This has been replaced by the 'KCML_File_Stat call.
Example
REM DIM status DIM stat$_KCML_FILE_STAT CALL KI_STAT "C:/KCMLDev/Trunk-13/kcml/master/kconf.xml", SYM(stat$) TO status PRINT FLD(stat$.KST_size)
There are also some built in constants associated with KST_mode field. These can be tested using AND and OR operators
Example
$COMPLIANCE 3 DIM a$_KCML_FILE_STAT CALL KI_STAT "c:/windows", SYM(a$) PRINT FLD(a$.KST_mode) SELECT CASE ('GB_BitMask(FLD(a$.KST_mode), _K_IFMT)) CASE _K_IFDIR PRINT "Directory" CASE _K_IFREG PRINT "Regular" CASE _K_IFCHR PRINT "" CASE ELSE PRINT "Other" END SELECT IF ('GB_BitMask(FLD(a$.KST_mode), _K_IRUSR)) PRINT "User read" END IF $END PUBLIC DEFSUB 'GB_BitMask(TestInt, Mask) LOCAL DIM Result$5 Result$ = BIN(TestInt, 5) AND BIN(Mask, 5) RETURN VAL(Result$, 5) END SUB