Opens the specified file and returns a handle to the JPL callerint sm_fio_open(char *path, char *mode);
- Path name of file to open.
- Describes the file type—binary or text—and type of access required, one of the following constants described in Table 5-6 in Description.
sm_fio_openopens a file in the specified mode and returns an integer handle to a file stream that is accessible to other Panther library file I/O functions. Supply this handle to these functions for all subsequent I/O operations on the file stream.
Note: The file stream that is opened by
sm_fio_openis not accessible to standard C library functions.
You can open a file in one of the modes shown in Table 5-6:
Table 5-6 File access modes
Mode identifier Access description
Open read-only text file.
Open read-only binary file.
Create write-only text file.
Create write-only binary file.
Open text file for append.
Open binary file for append.
Open binary file for update.
Create binary file for update.
Open binary file for append or update.
If a server executes this command, it must have the necessary permissions for the requested operation to the specified path. For example, when a Web client issues
sm_fio_opento create or open a file, the Web application server's user ID must have write permission to that file's directory.
// this validation routine is attached to a
// push button on a dialog screen that gets the
// user-entered name of a file and opens it
vars fileStream = SMFIO_INVALID_HANDLE
receive BUNDLE mode DATA operation
if (operation == "w")
fileStream = getFileHandle(file, "w")
if (operation == "r")
fileStream = getFileHandle(file, "r")
// All-purpose routine for supplying file handles
proc getFileHandle(fileName, mode)
fileHandle = sm_fio_open(fileName, mode)
if fileHandle < 0
msg emsg "I/O error :fileHandle - reenter file name
if fileHandle >= 0
send BUNDLE f_handle DATA fileHandle