binarynonsense / comic-book-tools

ACBT - Command-line conversion and creation tools for comic book files (Windows & Linux)
BSD 2-Clause "Simplified" License
6 stars 0 forks source link

Default or custom TEMP Folder can't be cleaned up #1

Closed 5h4k3 closed 1 year ago

5h4k3 commented 1 year ago

I'm not very familiar with the command line, but everything seems to work as expected except that the folder created during the conversion in the user temp (default) or in a custom one (cf screenshot Tests) can't be deleted in the end.

Maybe it's my pc? I don't know, but being in administrator doesn't change something either. And I'm able to rmdir the folder. It's more like ACBT can't.

And for what it worth, I think, sometimes, it's same with ACBR. I found several old folders of books converted several days ago that wasn't deleted (around 20GB). But, I need to look closer and more carefully. And if true, I will post in the ACBR section.

Screenshot Tests

5h4k3 commented 1 year ago

~Ok, forget what i just said. I don't know why but after reopening terminal, it work as expected with no error or whatever.~

Nice to see, it keep comicinfo.xml ! Thanks... !

5h4k3 commented 1 year ago

No, I don't understand why it finally worked but it doesn't again now. And it stop at the error, impossible to convert more than one book from the folder.

Capture

binarynonsense commented 1 year ago

Do those comic files have folders inside them? I think I've spotted a bug in a line I added for safety measures that may prevent it from deleting folders inside the created temp folder... I don't think any of my test files have folders so I'm betting that's the case, I'll test it and try to fix it when I have the time.

binarynonsense commented 1 year ago

I've uploaded a new release (v1.0.1) that should fix this.

PS: I don't think the same should happen in ACBR, could the folders you found be from failed conversions from previous versions? I use the temp folder in case things like this happen but I'll think about places where the program could not clean up after itself correctly (errors I don't catch and break the conversion?) to avoid leaving things behind even there.

binarynonsense commented 1 year ago

Just noticed that the release I just uploaded still has some problems, let me work on another one before you test it.

binarynonsense commented 1 year ago

Ignore my last comment :) Version 1.0.1 should be fine.

binarynonsense commented 1 year ago

And for what it worth, I think, sometimes, it's same with ACBR. I found several old folders of books converted several days ago that wasn't deleted (around 20GB). But, I need to look closer and more carefully. And if true, I will post in the ACBR section.

I didn't think so at first and haven't tested it yet but now I realize that you may be right and the same thing may be happening with ACBR (files containing subfolders breaking the cleanup). If that's the case, I'll try to fix it the same way and release an update for that one too as soon as I can.

Update: Just took a look at the code and tested it and I think I was right the first time, the problem ACBT had doesn't seem to be present in ACBR, it came from some new lines I wrote when adding custom temp paths to ACBT.

5h4k3 commented 1 year ago

Oh... I hadn't thought to test with or without folders...

Nice ! It works perfectly ! With or without a lot of folders or w/wo ComicInfo.xml !

Just a little info that doesn't matter, it seems to not like accents (é, è, à, etc...). It replace every occurence with a �. But it does the job and well so that's a detail.

Thank you !

binarynonsense commented 1 year ago

Just a little info that doesn't matter, it seems to not like accents (é, è, à, etc...). It replace every occurence with a �. But it does the job and well so that's a detail.

That's annoying... looks related to character encoding but I've tried to replicate it on linux and windows converting a file I named "téstçö.cbz" and haven't been able to replicate it...

I'd need some help to try to figure this out:

5h4k3 commented 1 year ago

Sorry for not having answered sooner. This happened to me several times but it seems to be due to bitrot on old files or simply errors. Everything is working fine so far...

binarynonsense commented 1 year ago

That's a relief, thanks for letting me know.