Allows to check if a file or a directory is present on a PC, and the granted rights on a file.
Syntax
CHGVAR |
VAR(&CMD) VALUE('CHKFILE') |
CHGVAR |
VAR(&PARM1) VALUE(' "File" [;Read] [;Write] [;Wait=number od seconds] [;GetInfo] ') |
CHGVAR |
VAR(&PARM2) VALUE(' ') |
CALL |
PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 &PARM2 &RESULT) |
Parameters
Parameters |
|
Parm1 or Parm2 |
Full path to file or directory. Read : Specify this option to check file reading right. Write : Specified this option to check file writing right. Wait=nnn; nnn is a number of seconds. Delay for waiting for the file availability. GetInfo=True; To
receive into RESULT the informations of the file. Position 16 : HHMMSS.mmm : Time last modification. Position 27 : TTTTTTTTTTTT : Size in bytes (12 characters). Position 40 : D if the path corresponds to a directory. |
RESULT |
Position 1 : TRUE / FALSE / DENIED / SHV Position 7: Information of file if Getinfo=True
TRUE : The file exists, the requested rights are granted. FALSE : The file does not exist. DENIED : The file exists, but the reading and/or writing requested rights are not granted. SHV: The file exists, but it is used by another application.
|
Example
CHGVAR VAR(&CMD) VALUE('CHKFILE')
CHGVAR VAR(&PARM1) VALUE('"%LNCDIR%\SAMPLES\LNCMENU.DOC";READ;+
WRITE')
CHGVAR VAR(&PARM2) VALUE(' ')
CALL PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +
&PARM2 &RESULT)
Other example
LNCCMDR CMD(CHKFILE) PARM1('"' *TCAT &OUTDIR *TCAT +
'\' *TCAT &NOMLOT *TCAT +
'.pdf";Getinfo=true') RESULT(&RESULT)