IBM Books

Reference

Access to Flat File Data Sources

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:

%DEFINE myfile = "/macros/myfile.txt" @DTWF_READ(myfile, ...)

The following sections discuss:

How Net.Data Determines the Flat File Location

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

And, the file is located in both the current directory and /macros/org1. If the function call is:

DTWF_READ("myfile.txt")
 

Net.Data will use /macros/org1/myfile.txt.

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.

Determining the Current Directory:

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.

Flat File Configuration Rules

Use the following rules when adding or updating the FFI_PATH in the Net.Data initialization file:

Security Recommendations

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:

Authorization Requirement

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.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]