CDOpen
(FUN)
FUNCTION CDOpen : RTS_IEC_HANDLE
Open a character device file. Given a pathname for a file, open() returns a file descriptor handle for use in subsequent system calls (read(), write(), ioctl(), etc.).
- InOut:
Scope
Name
Type
Comment
Return
CDOpen
RTS_IEC_HANDLE
Handle or RTS_INVALID_HANDLE if failed.
Input
szFile
STRING(80)
- File name. File name must be an absolute path to the
file. Path entries must be separated with a ‘/’ and not with a ‘"!
dFlags
DINT
- Requested ACCESS_MODE for fileaccess: dwFlags must include one of the following flags:
O_RDONLY: read-only access
O_WRONLY: write-only access
O_RDWR: read/write access
Optional flags for fileaccess: See linux man page for Details
pResult
POINTER TO DINT
Pointer to linux errno error code, 0 is ok