in reply to Re: knowing the current directory
in thread knowing the current directory
I've had problems with Cwd in the unix environment whenever your process is non-root and is working in a subdirectory of a directory that has the execute bit witout the read bit set.
My understanding is that Cwd essentially just does a CD .. until it gets to / and then CD's back to where it came from. But, if it can not read every single directory on the way back to / it gets confused.
There is a way to get Cwd make a system call to /bin/pwd, but if that's all the module is good for, then you might as well just do something like this:
chomp ( my $dir = `/bin/pwd` );
There probably is some way to make Cwd always do the right thing. If anybody knows what that is, I'd love to know
|
|---|