- According to the File::Spec docs, which say:
No physical check on the filesystem, but a logical cleanup of a path.
you would be breaking the promise that this is as good as it gets without touching the filesystem.
- The other OS's don't need to worry about symlinks - thus "d/.." is always the same as ".". That's why a string manipulation works. On Windows, I don't need to check the filesystem to know that "a\b\c\d\.." is always always always the same as "a\b\c". On Unix, I can't make that guarantee.
So your answer is to create a new function, obviously with different documentation. Your option 2 is going to get all the unix zealots (where "zealot" is defined as "someone who cares about accuracy) to cry "don't use it!" to anyone asking about it. That's just not going to be an option for something that is part of the core distribution: above all, it must be reliable and accurate. (That's not to say everything in the core is reliable and accurate, but, so far, File::Spec is that, so we don't want to make it worse.)
Your option 1 is the only reasonable approach in my opinion. But I'm not sure how complex this really is:
use Cwd;
our *abs_path = Cwd::abs_path;
Put those two lines in File/Spec.pm, add some documentation, and I think we're done.
I like that File::Spec doesn't touch the filesystem. I like that Cwd does. I'm not sure where the advantage of mixing these together is off-hand. | [reply] [d/l] |