home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / posix / sys / stat / fixpath.txh < prev    next >
Encoding:
Text File  |  1996-08-31  |  1.0 KB  |  37 lines

  1. @node _fixpath, file system
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <sys/stat.h>
  6.  
  7. void _fixpath(const char *in_path, char *out_path);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function canonicalizes the input path @var{in_path} and stores the
  13. result in the buffer pointed to by @var{out_path}.
  14.  
  15. The path is fixed by removing consecutive and trailing slashes, making
  16. the path absolute if it's relative, removing "." components, collapsing
  17. ".." components, adding a drive specifier if needed, and converting all
  18. slashes to '/'.  DOS-style 8+3 names of directories which are part of
  19. the pathname, as well as its final filename part, are returned
  20. lower-cased in @var{out_path}, but long filenames are left intact.
  21. @xref{_preserve_fncase}, for more details on letter-case conversions in
  22. filenames.
  23.  
  24. @subheading Return Value
  25.  
  26. None.
  27.  
  28. @subheading Example
  29.  
  30. @example
  31. char oldpath[100], newpath[100];
  32. scanf(oldpath);
  33. _fixpath(oldpath, newpath);
  34. printf("that really is %s\n", newpath);
  35. @end example
  36.  
  37.