June, 1997: dL4 Filenames

The difference between Portable & Native filenames

Now that dL4 is available for both UNIX and Windows 95/NT, it is a good time to review how filenames are treated in dL4. All filenames in dL4, for both data and program files, are treated as either portable filenames or native (operating system dependent) filenames. Both portable and native filenames are file paths and may contain one or more directory names. Because a portable filename can be used on any operating system, programs should use portable filenames whenever possible.

A native filename is any filename using an absolute path. All other filenames (i.e., relative paths) are handled as portable filenames. Thus, under UNIX, a native file name is any filename that begins with a “/” character. Under Windows 95/NT, a native filename is any filename that begins with “<drive-letter>:\” (a DOS style path) or “\\” (a Microsoft UNC path). A UNIX style native filename will not be recognized under Windows 95/NT and will be treated as a portable filename. For the same reason, a Windows native filename will be treated under UNIX as a portable filename.

Native filenames are passed unchanged to the operating system and can contain any character supported by the operating system. Native filenames may or may not be case sensitive depending on the operating system.

Since all absolute paths are native filenames, it follows that portable filenames are all relative paths. When used for data files, portable filenames are relative to the current working directory. Portable filenames are always case insensitive; all characters in the filename are converted to lowercase under UNIX and to uppercase for Windows 95/NT. While any relative path is treated as portable, a dL4 program, if it is to be truly portable, should use filenames consisting only of the following characters:

The filename should never begin with the characters “/” or “:”. In portable filenames, the characters “/” and “:” are directory separators and can be used interchangeably. Filename length may need to be limited if compatibility with older system is necessary. Reserved names under Windows 95/NT, such as AUX, CON, or PRN, should be avoided. A comparison of portable and native filename requirements is shown below:

Sample Filenames & Definitions
Sample Filename Filename Description
Sales/customerdata
Sales/CustomerData
sales:CustomerData
Portable filenames, (always case insensitive),that refer to the same file, “customerdata”, in the directory “Sales” within the current directory. These names can be used in both UNIX and Windows 95/NT.
/Sales/CustomerData Native filename under UNIX for the file “CustomerData” (case sensitive) in the directory “Sales” in the root directory. Portable filename under Windows and relative to the current directory, not current drive. Similar native filenames in Windows are “E:\Sales\CustomerData” or “\\Server\Sales\CustomerData”.
/Sales/customerdata Native filename under UNIX for the file “customerdata” in the directory “Sales” in the root directory. As UNIX names are case sensitive, this is not the same as “/Sales/CustomerData”.
c/data
c:data
Portable filenames referring to the file “data” in the “c” directory within the current direc-tory. Note: Even under Windows, “c:data” is equivalent to “c/data”, not a native filename.
c:\data Native filename under Windows for the file “data” on drive “C”. Under UNIX, this is the portable filename “c:\data” in the current directory.
\data Portable filename under UNIX and Windows. Under UNIX, it accesses the file “\data” in the current directory. Behaves the same in Windows except the leading “\” is ignored.

dL4 Filename Comparison
Portable Filenames Native Filenames
Not changed when moving to different operating system. Changed when program moved between UNIX & Windows 95/NT.
Always relative paths. Data files are relative to the working directory. Always absolute paths.
Case insensitive Case sensitivity is operating system defined.
Should only contain the characters A-Z, a-z, 0-9, /, :, period, underscore, dash, forward slash, or colon. Character set is operating system defined.
First character of filename should not be “/” or “:” UNIX names begin with “/”. Windows names begin with “<letter>:\” or “\\”.
“/” and “:” used as directory separators. Directory separators are operating system defined. UNIX = “/” and Windows = “\”
Windows reserved names (i.e. AUX, CON, PRN) should not be used and cannot be used under Windows. Windows reserved names (i.e. AUX, CON, PRN) cannot be used under Windows.


support@dynamic.com
800.822.2742
949.215.1200