Package: gio

Function g-file-basename

Lambda List

g-file-basename (file)

Arguments

file -- a input g-file object

Return Value

A string containing the base name of the g-file object, or nil if the given g-file is invalid.

Details

Gets the base name, the last component of the path, for a given g-file object. If called for the toplevel of a system, such as the filesystem root or a URI like sftp://host/, it will return a single directory separator, and on Windows, possibly a drive letter.

The base name is a byte string, not UTF-8. It has no defined encoding or rules other than it may not contain zero bytes. If you want to use filenames in a user interface you should use the display name that you can get by requesting the "standard::display-name" attribute with the g-file-query-info function.

This call does no blocking I/O.
 

See also

*2021-10-21