SysFileClose (FUN) ¶ FUNCTION SysFileClose : RTS_IEC_RESULT Close a file specified by handle InOut: Scope Name Type Comment Return SysFileClose RTS_IEC_RESULT Returns the runtime system error code (see CmpErrors.library) Input hFile RTS_IEC_HANDLE Handle of the file
SysFileCopy (FUN) ¶ FUNCTION SysFileCopy : RTS_IEC_RESULT Copy one file to another. A standard path will be added to the filename, if no path is specified. InOut: Scope Name Type Comment Return SysFileCopy RTS_IEC_RESULT The runtime system error code (see CmpErrors.library) Input szDestFileName STRING Destination 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 (\)! szSourceFileName STRING Source 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 (\)! pulCopied POINTER TO __XWORD Number of bytes copied
SysFileDelete (FUN) ¶ FUNCTION SysFileDelete : RTS_IEC_RESULT Delete the file specified by name. A standard path will be added in the runtime system to the filename, if no path is specified. InOut: Scope Name Type Comment Return SysFileDelete RTS_IEC_RESULT Returns 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 (\)!
SysFileDeleteByHandle (FUN) ¶ FUNCTION SysFileDeleteByHandle : RTS_IEC_RESULT Delete the file specified by handle InOut: Scope Name Type Comment Return SysFileDeleteByHandle RTS_IEC_RESULT Returns the runtime system error code (see CmpErrors.library) Input hFile RTS_IEC_HANDLE Handle of the file
SysFileEOF (FUN) ¶ FUNCTION SysFileEOF : RTS_IEC_RESULT Check, if end of file is reached Note End of file is only checked after a read operation with SysFileRead! But after a SysFileWrite or SysFileSetPos call, the function returns ERR_FAILED (no end of file)! InOut: Scope Name Type Comment Return SysFileEOF RTS_IEC_RESULT Returns the runtime system error code (see CmpErrors.library): ERR_OK: End of file reached at reading beyond the end of the file ERR_FAILED: No end of file reached ERR_PARAMETER: hFile is invalid Input hFile RTS_IEC_HANDLE Handle of the file
SysFileFlush (FUN) ¶ FUNCTION SysFileFlush : RTS_IEC_RESULT Flush the file cache and write into the file InOut: Scope Name Type Comment Return SysFileFlush RTS_IEC_RESULT Returns the runtime system error code (see CmpErrors_Itfs.library): ERR_OK: Succeeded flushing the file ERR_FAILED: Error occurred during file flush ERR_NOTIMPLEMENTED: File flush is not implemented ERR_NOT_SUPPORTED: File flush not available on the target Input hFile RTS_IEC_HANDLE Handle of the file
SysFileGetName (FUN) ¶ FUNCTION SysFileGetName : POINTER TO STRING Get the file name from file specified by handle InOut: Scope Name Type Comment Return SysFileGetName POINTER TO STRING File name of the specified file Input hFile RTS_IEC_HANDLE Handle of the file
SysFileGetName2 (FUN) ¶ FUNCTION SysFileGetName2 : POINTER TO STRING Get the file name from file specified by handle InOut: Scope Name Type Comment Return SysFileGetName2 POINTER TO STRING File name of the specified file Input hFile RTS_IEC_HANDLE Handle of the file pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library)
SysFileGetPath (FUN) ¶ FUNCTION SysFileGetPath : RTS_IEC_RESULT Get the path of this file. If a path is specified in the filename, the path will be extracted from the filename. If no path is specified in the filename, the standard path for this file extension type will be returned. InOut: Scope Name Type Comment Return SysFileGetPath RTS_IEC_RESULT The runtime system error code (see CmpErrors.library) Input szFileName STRING File name. Can contain an absolute or relative path Inout szPath STRING Path for this file Input diMaxLen DINT Maximum size in bytes of path length
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