In <[EMAIL PROTECTED]>, mal content <[EMAIL PROTECTED]> typed:
> For example, this path corresponds to the current working directory:
> 
>   "dir1/dir2/dir3/../../../"
> 
> So I'd like to be able to pass that to a function and get the optimised
> result of:
> 
>   "."
> 
> It's giving me a real headache trying to work out the algorithm
> to do this.

If you just want the algorithm, the python distribution has one in
posixpath.py: the normpath function. Heed the warning about symbolic
links.

        <mike
-- 
Mike Meyer <[EMAIL PROTECTED]>          http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to