BOOTSTRAP (kutils) functions
LIBRARY ROUTINE
ktbpath - Expand a environment variables local to a toolbox
LIBRARY CALL
char *ktbpath(
const char *filename,
char *tbpath)
INPUT
- filename - the file to be expanded
OUTPUT
- tbpath - if the return file is not NULL then
this will be where it place the path
to the expanded file. Otherwise, it will
kmalloc the space required.
RETURN VALUE
pointer to tbpath if it is not NULL, or
a pointer to a kmalloc'ed string containing
the result.
DESCRIPTION
This function returns the full path to the
user supplied file. "ktbpath", like "kfullpath",
expands all environment variables in a path, and
returns a full path back the user.
If the file specified with a ~username, then
the path will be expanded. The difference
between "ktbpath" and "kfullpath" is that
"ktbpath" tries to expand the relative to the
list of toolboxes. So for example if the path
handed in is:
/usr/data/test/tb/repos/Aliases
So if the path is inside the toolbox TBTEST which
has the path "/usr/data/test/tb", then the resulting
path will be
handed back as:
$TBPATH/repos/Aliases
ADDITIONAL INFORMATION
none
EXAMPLES
none
SIDE EFFECTS
if tbpath is NULL, it kmalloc's the return string
RESTRICTIONS
none
MODIFICATION
none
FILES
$BOOTSTRAP/objects/library/kutils/src/path.c
SEE ALSO
kutils(3)
COPYRIGHT
Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.