You use the FFI_PATH path configuration statement in the Net.Data initialization file to list the directories and sub-directories that are allowed to be specified when using the FFI functions and to provide security for those files not in directories included in the path statement. The Net.Data initialization file is shipped without FFI_PATH. See Net.Data Administration and Programming Guide to learn how to configure the path.
The FFI_PATH uses the following syntax:
FFI_PATH /path1;/path2;/path3...
When you call the FFI language environment in a macro function, you specify the path to the flat file that the FFI function is working with, using the filename parameter of the FFI function. For example:
@DTWF_READ("/macros/myfile.txt", ...)
The following sections discuss:
Net.Data uses the information in the filename parameter for FFI functions to search the FFI_PATH statement in the Net.Data initialization file and determine whether to use a specified directory or the current directory.
When a file name is specified on an FFI function, Net.Data attempts to locate the file by searching each of the paths listed in FFI_PATH, starting from the first path that is specified. Net.Data uses the first copy that it finds. If the file is not found, then Net.Data attempts to find the file in the current working directory of the process or thread in which Net.Data is running.
Example: Net.Data uses the FFI_PATH configuration statement to locate a file
The FFI_PATH contains the following directories:
FFI_PATH /macros;/macros/org1;/macros/org2
If the DTWF_READ function is being used to read an existing file, and a file name of myfile.txt is specified, then Net.Data searches the directories /macros, /macros/org1 and /macros/org2 for the file, assuming that the FFI_PATH contains the list of paths specified above. If the file is not found in any of the directories, then Net.Data searches the current working directory for the file.
If a file name of /mydir/myfile.txt is specified, Net.Data generates an error because the directory /mydir does not match one of the allowed directories specified in FFI_PATH.
Determining the Current Directory:
Net.Data uses the current directory when the file specified in an FFI function does not have a directory path and the file is not found in any of the directories specified in FFI_PATH.
The current directory for Net.Data depends on the configuration of your Web server:
Recommendations for specifying flat file access:
Use the following recommendations to ensure that Net.Data can access flat file data sources.
Use the following rules when adding or updating the FFI_PATH in the Net.Data initialization file:
You can specify which files FFI functions can access with the FFI_PATH statement in the Net.Data initialization file. FFI only searches the paths listed in the statement, so files in other directories are protected from unauthorized access.
For example, you can specify an FFI_PATH similar to the one below, designating directories for public or guest user IDs.
FFI_PATH C:\public;.\;E:\WWW;E:\guest;A:
The following list provides recommendations for making your flat files secure:
Ensure that the user ID under which Net.Data executes has access rights to files used by the FFI built-in functions. See the section on specifying Web server access rights to Net.Data files in the configuration chapter of Net.Data Administration and Programming Guide for more information.