SysFileGetPos (FUN) ¶ FUNCTION SysFileGetPos : RTS_IEC_RESULT Get actual file pointer position InOut: Scope Name Type Comment Return SysFileGetPos RTS_IEC_RESULT The runtime system error code (see CmpErrors.library) Input hFile RTS_IEC_HANDLE Handle of the file pulPos POINTER TO __XWORD Pointer to get actual position of the file pointer from the beginning of the file
SysFileGetSizeByHandle (FUN) ¶ FUNCTION SysFileGetSizeByHandle : __XWORD Get file size of the file specified by handle InOut: Scope Name Type Comment Return SysFileGetSizeByHandle __XWORD Size of the file in bytes Input hFile RTS_IEC_HANDLE Handle of the file pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library)
SysFileGetStatus (FUN) ¶ FUNCTION SysFileGetStatus : SYS_FILE_STATUS Get the file status InOut: Scope Name Type Comment Return SysFileGetStatus SYS_FILE_STATUS File status. See category file status Input hFile RTS_IEC_HANDLE Handle of the file
SysFileGetStatus2 (FUN) ¶ FUNCTION SysFileGetStatus2 : SYS_FILE_STATUS Get the file status InOut: Scope Name Type Comment Return SysFileGetStatus2 SYS_FILE_STATUS File status. See category file status Input hFile RTS_IEC_HANDLE Handle of the file pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library)
SysFileGetTime (FUN) ¶ FUNCTION SysFileGetTime : RTS_IEC_RESULT Get file time of the specified file. A standard path will be added to the filename, if no path is specified. InOut: Scope Name Type Comment Return SysFileGetTime RTS_IEC_RESULT The runtime system error code (see CmpErrors.library) Input szFileName STRING File name. File name can contain an absolute or relative path to the file. Path entries must be separated with a Slash (/) and not with a Backslash (\)! ptFileTime POINTER TO SYS_FILETIME Pointer to get the file time results.
SysFileOpen (FUN) ¶ FUNCTION SysFileOpen : RTS_IEC_HANDLE Open or create file. A standard path will be added to the filename, if no path is specified in the file name. If a file extension is specified in the settings, this path will be used (see category settings). Note File name can contain an absolute or relative path to the file. Path entries must be separated with a Slash (/) and not with a Backslash (\)! InOut: Scope Name Type Comment Return SysFileOpen RTS_IEC_HANDLE Handle to the file or RTS_INVALID_HANDLE if failed Input szFile STRING File name. File name can contain an absolute or relative path to the file. Path entries must be separated with a Slash (/) and not with a Backslash (\)! am ACCESS_MODE Requested access mode to the file. See ACCESS_MODE for details. Here find some examples: AM_READ If file does not exist, an error is returned. If the file exists, the file will be opened AM_WRITE If file does not exist, a new file will be created. If the file exists, it will be overwritten! AM_APPEND If the file does not exist, an error is returned. If the file exists, the file will be opened pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library)
SysFileRead (FUN) ¶ FUNCTION SysFileRead : __XWORD Read number of bytes out of the file InOut: Scope Name Type Comment Return SysFileRead __XWORD Number of bytes read from file. 0=if failed Input hFile RTS_IEC_HANDLE Handle of the file pbyBuffer POINTER TO BYTE Pointer to buffer for read data ulSize __XWORD Number of bytes to read from file. Must be less or equal the buffer size! pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library)
SysFileRename (FUN) ¶ FUNCTION SysFileRename : RTS_IEC_RESULT Rename the file. A standard path will be added to the filename, if no path is specified. InOut: Scope Name Type Comment Return SysFileRename RTS_IEC_RESULT Returns the runtime system error code (see CmpErrors.library) Input szOldFileName STRING Old file name. File name can contain an absolute or relative path to the file. Path entries must be separated with a Slash (/) and not with a Backslash (\)! szNewFileName STRING New file name. File name can contain an absolute or relative path to the file. Path entries must be separated with a Slash (/) and not with a Backslash (\)!
SysFileSetPos (FUN) ¶ FUNCTION SysFileSetPos : RTS_IEC_RESULT Set the file pointer to the specified position InOut: Scope Name Type Comment Return SysFileSetPos RTS_IEC_RESULT Returns the runtime system error code (see CmpErrors.library) Input hFile RTS_IEC_HANDLE Handle of the file ulOffset __XWORD Offset to set from the beginning of the file
SysFileTruncate (FUN) ¶ FUNCTION SysFileTruncate : RTS_IEC_RESULT Set a new filesize. May be larger or smaller than current size. InOut: Scope Name Type Comment Return SysFileTruncate RTS_IEC_RESULT Returns the runtime system error code (see CmpErrors.library) Input hFile RTS_IEC_HANDLE Handle of the file ulSizeNew __XWORD Size to set.