Syntax of File and Directory Names

You can choose to specify file and directory names generically or using platform-specific names—the ProcScript statements and functions for local file system management accept both.

At runtime, Uniface converts any directory or file specification into Uniface's internal representation of a directory or file. It then reassembles the full path specification into the syntax of the platform’s operating system and passes it to the operating system for execution.

File specification: {PathPrefix} {DirectoryPath} FileName {Extension} {Version}

Directory specification: {PathPrefix} DirectoryPath

  • PathPrefix—platform-specific indicator designating a file system or default location for the file or directory. To ensure platform-independence, it is best to define this prefix in a logical in the assignment file.
  • DirectoryPath—zero or more directories representing a path to the specified file.

    On most platforms this is a chain of directories, but on iSeries, Uniface maps the directory concept to native structures such as a library or dataset prefix.

  • FileName—name of a file, with no extension
  • Extension—extension of the file name.

Prefix

The PathPrefix can contain a platform-specific code indicating a drive, device, or file system, or a zip archive specification. Allowed values include:

  • Windows drive letter, for example D:
  • Network location that is specified using the Universal Naming Convention (UNC), which uses \\ or // to denote the root location and \ or / as other separators:
    • \\ServerName\NetName
    • \\ComputerName\ShareName.
    • //ServerName/NetName
    • //ComputerName/ShareName.
  • iSeries IFS indicatorIFS: or !:
  • Zip archive specification in the following format:

    {PathPrefix} {DirectoryPath}ZipFileName.zip:

    Recursive zip definitions are allowed (zip within zip).

To avoid using platform-specific ProcScript in your application, you can set logicals in the assignment file to contain hard-coded locations to prefix generic file or directory specifications.

Directory Path Syntax

If you specify a DirectoryPath, it is recommended that you use generic directory separators. Uniface can translate these into the appropriate separator on any supported platform. If you use platform-specific directory syntax, it is passed to the operating system without translation. This can lead to errors if the target file system uses a different syntax.

The generic separators are the same as those used on Windows, Unix and Linux.

  • Backward slash (\)
  • Forward slash (/)

Mixing directory separators in a path specification is permitted, for example, dir/subdir\myfile. Any other characters or directory separators are passed to the operating system as is, with no further syntax checking or translation.

It is usually preferable to use relative path indicators rather than hard-coding complete directory paths. Uniface recognizes the following relative path indicators and will try to resolve these on the target file system.

  • .\ or ./ or [] for the current path
  • ..\ or ../ or [-] for one level up in the path

Platform-Independent File and Directory Names

If your application will be deployed on different file systems, you should ensure that file and directory specifications are as generic as possible. Also consult the file-naming considerations for your target platforms. For more information, see Guidelines for Writing Platform-Independent ProcScript and File and Directory Naming Considerations on Specific Platforms.

Related Topics