BOOTSTRAP (kutils) functions


LIBRARY ROUTINE

kexpandpath - Expand a path to it's "true" path

LIBRARY CALL

char *kexpandpath(
   const char *filename,
   const char *globaldir,
   char *expandpath)

INPUT

OUTPUT

RETURN VALUE

expandpath if it is not NULL, the kmalloc'ed output string if expandpath is NULL, or NULL on error

DESCRIPTION

This routine takes an input pathname, and expands environment variables, khoros variables, ~'s , and logical paths to return the true path from / to the filename specified in the input. It does this by calling kfullpath to expand the first three expansions, and then changing the current working directory to the one containing the specified file and calling getcwd.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

if expandpath is NULL, the output string is kmalloc'ed

RESTRICTIONS

kexpandpath will fail if the directory specified does not already exist.

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.