home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / programm / 4609 < prev    next >
Encoding:
Internet Message Format  |  1992-09-10  |  972 b 

  1. Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!klaava!hurtta
  2. From: hurtta@cs.Helsinki.FI (Kari E. Hurtta)
  3. Newsgroups: comp.unix.programmer
  4. Subject: Re: pathname "cleanup" routine
  5. Message-ID: <HURTTA.92Sep10142337@plootu.Helsinki.FI>
  6. Date: 10 Sep 92 12:23:37 GMT
  7. References: <1992Sep10.043443.20693@leland.Stanford.EDU>
  8. Sender: news@klaava.Helsinki.FI (Uutis Ankka)
  9. Organization: Department of Computer Science, University of Helsinki, Finland
  10. Lines: 14
  11. In-Reply-To: schemers@leland.Stanford.EDU's message of 10 Sep 92 04: 34:43 GMT
  12.  
  13. In article <1992Sep10.043443.20693@leland.Stanford.EDU> schemers@leland.Stanford.EDU (Roland Schemers) wrote:
  14. > Before I reinvent the wheel, does anyone have or know of a
  15. > pathname "cleanup" function that will do the following:
  16. > Remove  "/../" and "/./" and "//" from a path.
  17. > Expand ~ and environment variables.
  18. > Add leading "/" if not present.
  19.  
  20. Warning:
  21.  
  22. if tmp is symbolic link, then
  23.     tmp/../foo    isn't same as    foo 
  24.  
  25. - K E H
  26.