Path name rules for APIs
When using an integrated file system or ILE C API to operate on an object, you identify the object by supplying its directory path. Here is a summary of rules to keep in mind when specifying path names in the APIs.
The term object in these rules refers to any directory, file, link, or other object.
- Path names are specified in hierarchical order beginning with the highest level of the directory hierarchy. The name of each component in the path is separated by a slash (/); for example:
Dir1/Dir2/Dir3/UsrFileThe backslash (\) is not recognized as a separator. It is handled as just another character in a name.
- Object names must be unique within a directory.
- The maximum length of each component of the path name and the maximum length of the path name string can vary for each file system.
- A / character at the beginning of a path name means that the path begins at the "root" (/) directory; for example:
/Dir1/Dir2/Dir3/UsrFile
- If the path name does not begin with a / character, the path is assumed to begin at the current directory; for example:
MyDir/MyFilewhere MyDir is a subdirectory of the current directory.
- To avoid confusion with i5/OS® special values, path names cannot start with a single asterisk (*) character. To specify a path name that begins with any number of characters, use two asterisks (*); for example:
'**.file'This only applies to relative path names where no other characters precede before the asterisk (*).
- When operating on objects in the QSYS.LIB file system, the component names must be of the form name.object-type; for example:
/QSYS.LIB/PAYROLL.LIB/PAY.FILE
- When operating on objects in the independent ASP QSYS.LIB file system, the component names must be of the form name.object-type; for example:
'/asp_name/QSYS.LIB/PAYDAVE.LIB/PAY.FILE
- Do not use a colon (:) in path names. It has a special meaning within the system.
- Unlike path names in integrated file system commands , an asterisk (*), a question mark (?), a single quotation mark ('), a quotation mark ("), and a tilde (~) have no special significance. They are handled as if they are just another character in a name. To avoid confusion with i5/OS special values, path names should not start with a single asterisk (*) character. The only APIs that are exceptions to this rule are QjoEndJournal and QjoStartJournal.
- When using the Qlg (using NLS-enabled path names) API interfaces, a null character value is not allowed as one of the characters in the path name unless a null character is specified as a path name delimiter.
Parent topic:
Performing operations using APIs
Related reference
Path name rules for CL commands and displays
Related information
End Journal (QjoEndJournal) API
Start Journal (QjoStartJournal) API