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

Creation of bag with relative bag fails unless ./ prefix is used #26

Closed
asmecher opened this issue Jun 18, 2021 · 0 comments · Fixed by #27
Closed

Creation of bag with relative bag fails unless ./ prefix is used #26

asmecher opened this issue Jun 18, 2021 · 0 comments · Fixed by #27

Comments

@asmecher
Copy link

The following code fails:

$bag = Bag::create('my_bag_path');

...with...

PHP Fatal error:  Uncaught whikloj\BagItTools\Exceptions\FilesystemException: Unable to put contents to file /my_bag_path/bagit.txt in /.../vendor/whikloj/bagittools/src/BagUtils.php:283

It appears that my_bag_path is interpreted as an absolute path unless you prefix it with ./

I'm not sure if this is intentional, but in my opinion this library should behave like the PHP file functions, which would interpret my_bag_path as a relative path unless there is a / prefix in front.

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

Successfully merging a pull request may close this issue.

1 participant