Gets the canonical file name from filename. All triple slashes are turned into
single slashes, and all .. and .s resolved against relative_to.
Symlinks are not followed, and the returned path is guaranteed to be absolute.
If filename is an absolute path, relative_to is ignored. Otherwise,
relative_to will be prepended to filename to make it absolute. relative_to
must be an absolute path, or null. If relative_to is null, it'll fallback
to g_get_current_dir().
This function never fails, and will canonicalize file paths even if they don't
exist.
No file system I/O is done.
Parameters
filename: string
the name of the file
Optionalrelative_to: string
the relative directory, or null to use the current working directory
Returns string
a newly allocated string with the canonical file path
Gets the canonical file name from
filename. All triple slashes are turned into single slashes, and all..and.s resolved againstrelative_to.Symlinks are not followed, and the returned path is guaranteed to be absolute.
If
filenameis an absolute path,relative_tois ignored. Otherwise,relative_towill be prepended tofilenameto make it absolute.relative_tomust be an absolute path, ornull. Ifrelative_toisnull, it'll fallback tog_get_current_dir().This function never fails, and will canonicalize file paths even if they don't exist.
No file system I/O is done.