+---------- On Mar 27, Zoran Vasiljevic said: > Tcl. This solves this issue cleanly. The ultimate fix, of course, is > to modify the Darwin realpath() to behave better.
I wonder what you mean by "behave better". Does realpath() leave the cwd changed? Or do you simply mean that you don't want realpath() to ever use chdir()? A correctly working realpath() must use chdir() at least sometimes. System calls only accept paths up to PATH_MAX bytes long, but the filesystem allows us to construct paths of any length. The only reliable way to access those long paths is by using chdir(). realpath() could safely use chdir() even in a multithreaded program by forking, computing the path (possibly using chdir()) in the child, and passing the result back to the parent over a pipe. Obviously this could be optimized to only fork when it discovers that it must call chdir(). -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list: http://www.aolserver.com/listserv.html List information and options: http://listserv.aol.com/
