Flexible NC programming
1.22 Read out file information (FILEDATE, FILETIME, FILESIZE, FILESTAT, FILEINFO)
Job planning
Programming Manual, 07/2010, 6FC5398-2BP40-0BA0
143
1.22 Read out file information (FILEDATE, FILETIME, FILESIZE,
FILESTAT, FILEINFO)
Function
The FILEDATE, FILETIME, FILESIZE, FILESTAT, and FILEINFO commands can be used to read
out specific file information such as date/time of the last write access, current file size, file
status or all of this information.
Note
The file must be stored in the NCK's static user memory (passive file system).
Condition
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
DEF INT <error>
DEF STRING[<string length>] <result>
FILE....(<error>,"<file name>",<result>)
Significance
FILEDATE: The FILEDATE command returns the date of the last write access to
the specified file.
FILETIME: The FILETIME command returns the time of the last write access to
the specified file.
FILESIZE: The FILESIZE command returns the current size of the specified file.
FILESTAT: The FILESTAT command returns the status of the specified file with
regard to read, write and execution rights.
FILEINFO: The FILEINFO command returns all file information for the specified file
which can be read out using
FILEDATE, FILETIME, FILESIZE, and
FILESTAT.
Variable for returning the error value (call-by-reference parameter)
Type. INT
0 No error
1 Path not allowed
2 Path not found
3 File not found
4 Incorrect file type
13 Insufficient access rights
<error>:
Value:
22 String length of the result variable (
<result>) is too
small.