TutSetFileOpenFunc set the function to use when opening a file
open_func
function to be used to open a file
TRUE
if successful, FALSE
otherwise.
None
TutSetFileOpenFunc allows you to specify a function used to open a file, instead of the default TutFOpen. This makes it possible to set up input data to come from a different place, or perform pre-processing on the file before it is read.
If NULL
is specified for open_func
, the default open function TutFOpen is used for subsequent file open operations.
None
TutSetFileCloseFunc, TutSetFileReadFunc, TutFOpen, TutFileTraverse
This example performs pre-processing on a file before opening it:
static FILE *open_func(file_name, file_mode) T_STR file_name; T_STR file_mode; { if (strcmp(file_mode, "r")) { return TutFOpen(file_name, file_mode); } preprocess_file(file_name);/* User written pre-processing */
return TutFOpen(file_name, file_mode); }/* open_func */
. . . TutSetFileOpenFunc(open_func); . . .
TIBCO SmartSockets™ Utilities Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |