File and Filename Routines

Restriction: The CBL_ routines within this section are not supported when CHARSET"EBCDIC" is in effect.

The File and Filename routines enable you to manipulate filenames.

A filename is split up into three discrete parts: path, basename and extension. Using the following example - d:\dir1\dir2\file.dat - the path is d:\dir1\dir2, the basename is file, and the extension is dat.

Filenames can be either space-terminated or null-terminated. Space-terminated filenames are terminated by a space character, and null-terminated filenames are terminated by the null character. Both space-terminated and null-terminated filenames have any double quotes stripped out, but retain any spaces within any part of the filename that is enclosed in double quotation marks, for example, the whole filename.

The routines in this section can work with filenames up to 65,535 characters long, but your environment and run-time system will impose a limit on what filename lengths can actually be used on a file system.