fgl_basename()

The file management functions allow for the management of files and directories. You are able to find the file name from a given path and similarly you can find just the directory from a given file path. You are also able to create and remove directories and paths.

fgl_basename(path, [suffix]) returns char(n) path.

When you specify a file name and its path, be careful with its case.

UNIX is case-sensitive, so it will treat files which names come in different cases as separate files.

The fgl_basename() function returns only the file name of a given path, and optionally strips the suffix from the file. For example:

fgl_basename("/tmp/docs/productX/xxx")

will return 'xxx', as will the call:

fgl_basename("/tmp/docs/productX/xxx.4gl", ".4gl")

where the suffix, ‘.4gl’ has been specified in the function call, thereby removing the ‘.4gl’ extension. If an incorrect suffix is specified but the file does exist, then the function will return the file name with that suffix. The function has been designed so that the file suffix is not necessarily the file extension; it simply returns the last section of the path. It is assumed that this is a file, but it may be a folder, in which case the folder is returned.

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.