Professional Documents
Culture Documents
CoDeSys V 3.x
SysDir.library
CONTENT
1 OVERVIEW 3
2 LIBRARY MODULES 4
2.1 SysDirCreate 4
2.2 SysDirOpen 4
2.3 SysDirRead 4
2.4 SysDirDelete 5
2.5 SysDirRename 5
2.6 SysDirGetCurrent 5
2.7 SysDirSetCurrent 6
2.8 SysDirClose 6
2.9 DirFileTime 6
2.10 DirInfo 6
CHANGE HISTORY 7
libdoc_e.dot / V1.0
1 Overview
Hinweis: Es hngt vom verwendeten Zielsystem ab, welche Systembibliotheken im Steuerungsprogramm verwendet
werden knnen.
If supported by the runtime system, you can use the functions of this library to handle a file
directory system on the target system. Entries of the directory can be read and modified. The
execution is synchronous.
The functions:
SysDirOpen
SysDirCreate
SysDirRead
SysDirRename
SysDirSetCurrent
SysDirGetCurrent
SysDirClose
SysDirDelete
DirFileTime
DirInfo
libdoc_d.dot / V1.0
2 Library modules
2.1 SysDirCreate
This function serves for creating a directory.
The return value of type UDINT contains an error code which tells about the success of the
operation. See document Runtime Error Codes.
Input-Variable Data type Description
2.2 SysDirOpen
This function can be used to open a directory in order to read the directory entries (files,
subdirectories) via function SysDirRead.
The return value of type UDINT is a handle, which is required by function SysDirRead as an
input. In error case an invalid handle (-1) will be returned.
Input-Variable Data type Description
2.3 SysDirRead
This function serves for reading directory entries.
Each time the function is called, one entry of the directory will be read. As long as "1" is
returned, a further entry is in the directory. Thus for reading all entries the function must be
called repeatedly until "0" is returned. In this case, the directory is closed and the handle is
not valid any more. In every case, the function has to be called until it returns 0 to close the
directory.
2.4 SysDirDelete
This function can be used to delete a directory.
The return value of type UDINT contains an error code which tells about the success of the
operation. See document Runtime Error Codes.
Input-Variable Data type Description
2.5 SysDirRename
This function can be used to rename a directory.
The return value of type UDINT contains an error code which tells about the success of the
operation. See document Runtime Error Codes.
Input-Variable Data type Description
2.6 SysDirGetCurrent
This function returns the name of the current directory.
The return value of type UDINT contains an error code which tells about the success of the
operation. See document Runtime Error Codes.
Input-Variable Data type Description
szDir REFERENCE TO The name of the current directory will be written to this
STRING string.
dMaxDirLen DINT Maximum length of the string written to szDir
libdoc_d.dot / V1.0
2.7 SysDirSetCurrent
This function sets the current directory.
The return value of type UDINT contains an error code which tells about the success of the
operation. See document Runtime Error Codes.
Input-Variable Data type Description
2.8 SysDirClose
This function closes the directory which has been opened via SysDirOpen.
The return value of type UDINT contains an error code which tells about the success of the
operation. See document Runtime Error Codes.
Input-Variable Data type Description
2.9 DirFileTime
This structure contains information on date and time of the last access and last modification of
a directory entry. It is used by structure DirInfo. The data are given in IEC time format.
Structure component Data type Description
2.10 DirInfo
This structure contains information on a directory entry which is read via functions
SysDirRead.
Strukturkomponente Data type Description
Change History
Version Description Date