Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing chdir / curdir and updir aren't always '.' and '..' ( File::Spec->curdir ) #81

Closed
ghost opened this issue Dec 29, 2013 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 29, 2013

It would be nice if path( $dir )->chdir worked and threw exception if chdir failed (its like autodie)

otoh, you have hardcoded '.' and '..' in sub children , but for portability, you should probably use File::Spec->curdir and File::Spec->updir, because on some systems they aren't '.' and '..' like File::Spec::VMS and File::Spec::Mac

hmm, so how to get '.'
path( File::Spec->curdir ) is kinda lettery
path( ['curdir'] )
path( ['.'] )
path( \'.' )
path( \'..' )

Thanks

@dagolden
Copy link
Collaborator

If I understand correctly, you want $path->chdir for the exception on failure? Rather than:

use autodie;
chdir $path;

I've tried to avoid replicating all the built-in functions when there isn't additional functionality (or simplicity) to be gained from it. I'll think about it. (Actually, I'll open a separate ticket for it: #82)

Path::Tiny isn't intended to be maximally portable -- and is documented so. It attempts to use File::Spec as little as possible due to the overhead of it, so it will continue using "." and "..". I'm going to close this ticket, but I'll leave the new chdir one open for consideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants