Work preparation
3.5 File handling
Examples
Example 1
Program code
N10 DEF BOOL RESULT
N20 RESULT=ISFILE("TESTFILE")
N30 IF(RESULT==FALSE)
N40
N50
N60 ENDIF
...
Example 2
Program code
N10 DEF BOOL RESULT
N20 RESULT=ISFILE("TESTFILE")
N30 IF(NOT ISFILE("TESTFILE"))
N40
N50
N60 ENDIF
...
3.5.5
Read out file information (FILEDATE, FILETIME, FILESIZE, FILESTAT,
FILEINFO)
The FILEDATE, FILETIME, FILESIZE, FILESTAT, and FILEINFO commands read out
specific file information such as date/time of the last write access, current file size, file status or
all of this information.
Requirement
The currently set protection level must be equal to or greater than the show right of the
superordinate directory. If this is not the case, access is denied with an error message (return
value of error variable = 13).
Syntax
FILE....(<Error>,"<File name>",<Result>)
Meaning
FILEDATE:
FILETIME:
FILESIZE:
572
MSG("FILE DOES NOT EXIST")
M0
MSG("FILE DOES NOT EXIST")
M0
Returns the date of the last write access to a file
Returns the time of the last write access to a file
Returns the current size of a file
Comment
; Definition of result variables.
Comment
; Definition of result variables.
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0
NC programming