KI_STAT

File information

Synopsis:
CALL KI_STAT path$, SYM(rowbuf$()) TO [status]
'ki_stat( path$, SYM(rowbuf$()), [status] )
ArgumentEnumerationPurpose
path$Pathname
SYM(rowbuf$())Row buffer or row buffer array
statusKDB_ERROR_ENUMOptional return status
>KI_STAT

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
History
Introduced in KCML 6.60
See Also:
IP_TOS, KI_AES_DECRYPT, KI_AES_ENCRYPT, KI_COMP, KI_COMPFILE, KI_CRYPT, KI_DCOMP, KI_DCOMPFILE, KI_DES_DECRYPT, KI_DES_ENCRYPT, KI_DF, KI_DFK, KI_DIR, KI_DIR_LIST, KI_DS, KI_MD5, KI_PID, KI_PMATCH, KI_SHA1, KI_SIZE, KI_STATFS, KI_TOUCH, R7_DATE2J, R7_J2DATE
KCML database status codes