|
Appendix |
File Name Handling |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Naming Conventions and File Extensions Using Operating System Commands as Arguments
|
File names can be used throughout Omnidex to point to files containing information pertinent to the immediate task. From declaring the physical location of data files in an Omnidex Environment file to passing a USE file for testing an application in ODXSQL, Omnidex offers several options for using and passing physical file names.
Naming Conventions and File ExtensionsOmnidex uses a standard set of file extensions, suffixes, when dealing with file types specific to the software, some required and some optional. Following is a list of required and recommended file extensions:
Limitations
Environment VariablesEnvironment variables can be used anywhere that file names are used. They can be passed in place of, or in conjunction with, a file name. Omnidex supports operating system syntax as well as its own, universal syntax, for using environment variables. For example, assume the environment variable APPLICATION_HOME has been set to point to the main application directory on a server. The syntax to reference that environment variable, in the INDEXPREFIX declaration in the Omnidex Environment file for example, is as follows: Windows SyntaxINDEXPREFIX "%APPLICATION_HOME%\idx\orders" UNIX SyntaxINDEXPREFIX "$APPLICATION_HOME/idx/orders" Omnidex SyntaxINDEXPREFIX "{$APPLICATION_HOME/idx/orders}" This last example will translate the line to the proper operating system
syntax.
Passing Multiple File NamesOmnidex supports the use of multiple files in some places like the PHYSICAL clause of the TABLE statement in the Omnidex Environment file. Multiple file names can be passed in two ways:
Wildcard CharacterThe syntax for passing multiple file names with a wildcard card character is much like the operating system syntax. Each file must adhere to the 255 character length limit, however, there is no limit to the number of files that can be included with this wildcard character. For example, assume there are several .dat files in the same directory, they can be referenced by: data/*.dat data/sales*.dat sales2003.* *.*
Comma-Separated ListMultiple files can be passed using a comma-separated list of file names. Each file spec must adhere to the 255 character length limit, however, there is no limit to the number of files that can be passed in the comma-separated list. The file list can span multiple lines and can include carriage returns. PHYSICAL "data/sales1.dat,data/sales2.dat,data/sales3.dat,data/sales4.dat"
System CommandsOmnidex supports the use of system commands as an argument. The output of the system command will be used as the argument value. Passing environment variables is one example of using system commands in an argument. Another example would be to use the contents of a file. For example, the default user name can be stored in a file (username.txt) and passed using the cat or type system command. USER "type username.txt" The contents of username.txt are used at the USER argument.
ExamplesEnvironment VariablesIn this example, you want to make Omnidex put all of the Omnidex index files into the idx sub-directory of the main application directory, c:\omnidex, and prefix these index files with the filename "orders". In this example, an environment variable called APPLICATION_HOME points to this main application directory. You'll set the INDEXPREFIX clause of the DATABASE statement in the Omnidex Environment file to use this environment variable, as follows: INDEXPREFIX "%APPLICATION_HOME%\idx\orders" This will cause all of the index files to be created as follows: c:\omnidex\idx\orders0A The above example is on a Windows machine, however, the same can be accomplished on a Unix machine using Unix syntax.
Multiple Environment Variables can be concatenated together to form a single argument value. For example, assume the following environment variables have been set: APPLICATION_HOME = "/usr/omnidex/" The PHYSICAL clause of the TABLE section in the Omnidex Environment file can look like this: PHYSICAL "{$APPLICATION_HOME$DATA_FILES$SALES_DATA}"
Multiple Files Using a Wildcard CharacterIn this example, there are several .dat files located in the data subdirectory of the application's home directory. These .dat files are going to be defined together as a single table Physical clause of the Table section in the Omnidex Environment file. TABLE Sales Multiple Files Using a Comma-Separated List of FilesThe previous example can also be accomplished by concatenating all of the filenames together into a comma-separated list. TABLE Sales
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Home | What's New | Quick Links | Appendix |