FLfullName


Routine

int FLfullName (const char Fname[], char Fullname[])

Purpose

Expand a file name path

Description

This routine takes an input file name with path and tries to expand it to form a file name with an absolute path. The typical use of this routine is to log the full file name of a file that has already been opened, and hence for which the path is well defined and readable.

The basic strategy is to take the path and try to change the current working directory to this path. If this is unsuccessful, the rightmost component of the path is removed and the process is repeated. When (if) successful, the leftmost components are replaced by the current working directory. This results in a resolved, cleaned up path name. The rightmost components are appended to this to form the full path name. Note that the rightmost components may not been resolved, either because the directories specified therein do not exist on the current host or are unreadable.

Note that ~ characters in the file name are treated as ordinary characters.

Parameters

<- int FLfullName
Number of characters in the output string
-> const char Fname[]
Input character string with the file name path
<- char Fullname[]
Output string with the file name with resolved path name. This string is at most FILENAME_MAX characters long including the terminating null character. This string will be the input file name path if the path cannot be resolved.

Author / revision

P. Kabal Copyright (C) 1998 / Revision 1.31 1998/04/08

See Also

FLpathList


Main Index libtsp