Flexible NC programming
1.22 Read out file information (FILEDATE, FILETIME, FILESIZE, FILESTAT, FILEINFO)
Job planning
144 Programming Manual, 07/2010, 6FC5398-2BP40-0BA0
Name of the file from which the file information is to be read out.
Type: STRING
<file name>:
The following points should be noted when specifying the file name:
• The specified file name must not contain any blank spaces or
control characters (characters with ASCII code ≤ 32), otherwise
the
FILE... command will be canceled with error code 1 "Path not
allowed".
• The file name can be specified with path data and file identifier.
– Path data
Path data must be absolute, i.e. start with "/".
If a path is not specified, the file is searched for in the current
directory (= directory of selected program).
– File identifier
If the file name does not contain a domain identifier ("_N_"), it
is added accordingly.
If the fourth-last character of the file name is an underscore "_",
the next three characters will be interpreted as the file
identifier. In order to be able to use the same file name for all
file commands, e.g. via a STRING type variable, only the _SPF
and _MPF file identifiers may be used.
If there is no "_MPF" or "_SPF" identifier, the file name is
automatically completed with _MPF.
• The file name length can be up to 32 bytes, the path length up to
128 bytes.
Example:
"PROTFILE"
"_N_PROTFILE"
"_N_PROTFILE_MPF"
"/_N_MPF_DIR_/_N_PROTFILE_MPF/"
Result variable (call-by-reference parameter)
Variable in which the requested file information is stored.
FILEDATE
Format: "dd.mm.yy"
⇒ string length must be 8.
FILETIME
Format: "hh:mm.ss"
⇒ string length must be 8.
FILESTAT
Format: "rwxsd"
(r: read, w: write, x: execute, s: show,
d: delete)
⇒ string length must be 5.
STRING With:
FILEINFO
Format: "rwxsd nnnnnnnn dd.mm.yy
hh:mm:ss"
⇒ string length must be 32.
<result>:
Type:
INT With:
FILESIZE
The file size is output in bytes.