-
Notifications
You must be signed in to change notification settings - Fork 5
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
Issue with hard coded temp directory path #15
Comments
Creating /tmp/cbr2cbztemp-u501/p33649 That is the error. |
I'll add in the suggestion from issue #16 - an option to set the temporary folder. Looks like my working tree of the script (at home, I don't think it went up to Github) has different imagemagick commands (updated packages in Ubuntu Linux). I may need to add in an option for different command styles and try to work out why they changed. If there's a lot of variation between OSes there may be a need for short term aliasing of commands, and increased priority of redoing graphic conversion (primarily shrinking) with python library. Once the temp folder flag is in place I will probably need some feedback as to if the imagemagick is available/working on MacOS |
The hard coded temp directory path is an issue on more than MacOS, so I've renamed the issue and will close #16 as a planned workaround. I'll have to look into how to ask python what OS is being used and try to work out sensible defaults. Hopefully someone's already has good advice elsewhere. |
I've added a --tempdir option to the Test branch. Try it out with somewhere you know you can write to. If that doesn't work there must be something incompatible with MacOS with how I'm checking directory changing/existing that'll need more investigation. Note with --shrink I've reverted to ImageMagick6 command format by default (current on my Ubuntu 19.10). If using ImageMagick 7 use --imversion 7 |
The new tempdir option seems to work well. Interesting artifact, if I try and run it on the root of my ramdisk (or any disk) I get the errors below. If I declare a folder such as
|
Well, I sort of forgot Github existed for a while. Having a look at the code it expects that tempdir is a dedicated folder, the first thing it tries to do is clear out any contents. When it's pointed to /Volumes/ramdisk/ it tries to delete everything in there first (which it probably doesn't have permissions to do). I think this needs an update to create a subfolder even when it's explicity given a folder to work with. If someone tells it the tempdir is ~/ it'll probably go and delete as much of the user's home directory as it can. I'm thinking of having a list of default sensible temporary locations for as many OSes as people can suggest and have it check each in order until it finds one - then create sub directories in there. EDIT: The tempdir option didn't make it into the main branch or releases with the old (dangerous) behaviour. After a bit of reworking it's in main now, with --tempdir being used to point to an existing directory in which a temporary one is created, used and removed. |
New behaviour: Looks for the following folders in order:
Whichever exists has a cbr2cbz.PID# subdirectory created, used as temp and then cleaned up. Promoted to default branch after some modest testing. EDIT: Also added the current directory to the error line that started this issue - if it's still an issue it should at least tell us what it's expecting and what the current directory is. |
Update for Issue 15 adds UID to temp directory name to help with potential collisions in shared folders. |
I am testing cbr2cbz with a Mac OS. When I tried to run it with a sample file, I get the following error:
Creating /tmp/cbr2cbztemp-u501/p1292
Could not change to temp directory /tmp/cbr2cbztemp-u501/p1292
The directory is nevertheless created
The text was updated successfully, but these errors were encountered: