File names

This topic describes the file name and the limitations of using them.

The file server presents a DOS-like file system with long file names. For compatibility with traditional DOS filenames, an extension is recognized on names with appropriate formats.

When creating a file or directory note the following restrictions which apply to the path and its components.

  • The total length of the path including drive, path, name and extension, must not exceed 256 characters.

  • Wildcards cannot be used in any path component including the filename and extension, although some higher level classes allow the use of wildcard characters in the filename and extension. These classes are covered later in this guide.

  • Two consecutive backslashes are not allowed in the path.

  • The following characters must not be included anywhere in the path (all other characters are acceptable) < > " / |

  • A : (colon) may only be included immediately after the drive.

  • The path components are separated by \ backslashes, and a final backslash must be used to indicate that a name is a path.

  • Long filenames are supported, so a path or filename may have any number of full stops in it, with the exception that following the final backslash (the filename and extension), the space characters and names ". " and ".. " are not permitted as path components.

  • Spaces between the drive, if specified, and the first directory in the path are illegal, although there may be spaces between other path components, for instance between directories.

The file server does not use . and .. to mean current directory and parent directory respectively. If required, these must be implemented by higher-level code. The TParseBase class provides filename parsing and manipulation functions.

The function RFs::IsValidName() tells you whether a path name is valid or not.