ST_FILE_ATTR (ST)

The file attributes are saved in an 'ST_FILE_ATTR' type structure.

Structure elements

Name

Type

Description

strFileName

STRING(64)

File name, including extension

The attributes are saved in the structure.

enFileType

ENUM

EN_FILE_TYP

File type

Range

Meaning

FILE_TYPE_REG

Regular file

FILE_TYPE_DIR

Directory

FILE_TYPE_CHR

Character device

FILE_TYPE_BLK

Block device

FILE_TYPE_FIFO

Named pipe

FILE_TYPE_LINK

Symbolic link

FILE_TYPE_SOCK

Socket

wPermission

WORD

Access rights to file(byte-coded).

Where, e.g. 8#644 → '-,rw-,r--,r--'

where "-", rwx-Owner, rwx-Gruppe, rwx-Sonstige", and

where: r=read right, w=write right, x=execute right

udFileSize

UDINT

File length [bytes](corresponding to the return value of the 'SIZE_FILE_1' FB)

dtLastAccessTime

DATE_AND_TIME

Date and time of last access. (CODESYS "DT" type)

dtLastModificationTime

DATE_AND_TIME

Date and time of last change (CODESYS "DT" type)

dtLastStatChangeTime

DATE_AND_TIME

Date and time of last change of state (CODESYS "DT" type)

Structure definition

 

TYPE ST_FILE_ATTR:

 

STRUCT

   

strFileName: STRING(64);

enFileType: EN_FILE_TYPE;

wPermission: WORD;

udFileSize: UDINT;

dtLastAccessTime: DT;

dtLastModificationTime: DT;

dtLastStatChangeTime: DT;

 

END_STRUCT

END_TYPE