DeadSix27 / waifu2x-converter-cpp

Improved fork of Waifu2X C++ using OpenCL and OpenCV
MIT License
792 stars 86 forks source link

Catch EROFS when generating binary #184

Closed gloaming closed 4 years ago

gloaming commented 5 years ago

Recover from attempt to generate binary on a read-only file system, e.g. when running on NixOS.

DeadSix27 commented 5 years ago

Can you also change printf("ERROR: %s\n",e.what()); on line 532 to printf("Error creating directory: %s\n",e.what()); to make it clearer, otherwise LGTM.

gloaming commented 5 years ago

Sure! However, I only realised recently that the program doesn't actually read the binary from ~/.waifu2x - it gets overwritten each time. I guess the idea is that the user should manually copy the binary into the install dir?

If so, I think we should add a message to that effect, because I had no idea :) Furthermore, on NixOS, the user can't move the binary into the Nix store, so we need to read the binary from ~/.waifu2x to make it fast.

If that makes sense to you, I can look into making a second PR.

DeadSix27 commented 5 years ago

@gloaming the kernel overwriting PR is already being worked on in keep-kernel-merge, but otherwise my required changes are still standing.

gloaming commented 5 years ago

Sorry about that, pushed now.

gloaming commented 5 years ago

Bump

DeadSix27 commented 5 years ago

I'll look at this in a bit it may also conflicts with #207