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

Can't handle errors for copy_to on Unix #54

Open
wagnerflo opened this issue Dec 12, 2018 · 2 comments
Open

Can't handle errors for copy_to on Unix #54

wagnerflo opened this issue Dec 12, 2018 · 2 comments

Comments

@wagnerflo
Copy link

wagnerflo commented Dec 12, 2018

Since on Unix platforms Path::Class::File::copy_to uses system() to run cp handling (or even logging) copy errors is impossible in my daemon: The cp writes it's error messages to a stderr that has been closed long ago...

@wagnerflo wagnerflo changed the title Can't handle errors for copy_to on Unix Can't handle errors for copy_to on Unix Dec 12, 2018
@kenahoo
Copy link
Owner

kenahoo commented Dec 13, 2018

Thanks for the report. My assumption is that the system cp performs better than the Perl emulation in File::Copy::cp, and handles permissions cases better, but I haven't really verified any of that. I agree that it makes error checking more difficult (the caller doesn't know whether it should check $? or $@ or $! or what).

Would using File::Copy::cp work better in your use case, and if so, do you know a performance comparison?

@wagnerflo
Copy link
Author

Yes. For now I've replaced copy_to with File::Copy::cp and can handle and log errors like that. I have no idea about performance, though.

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

2 participants