The CBL_JOIN_FILENAME and CBL_SPLIT_FILENAME routines enable you to parse a filename into its component strings and to join strings together to form a filename. They can be used together to replace components of a filename, such as the extension. They can handle both null-terminated and space-terminated filenames.
A filename is split up into path, basename and extension. For example, in the filename d:\dir1\dir2\file.dat the path is "d:\dir1\dir2", the basename is "file", and the extension is "dat".
These two routines can work with filenames up to 65,535 characters long, but your environment or run-time system imposes a limit of 256 characters on the maximum length of basename.ext , and 261 characters on the maximum length of the entire filename.