Welcome, Guest
Python Scripts for ComicRack

TOPIC: malor89's Perl Scripts

Re: malor89's Perl Scripts 6 years 5 months ago #15618

  • ChapeL
  • ChapeL's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 16
  • Thank you received: 1
  • Karma: 0
600WPMPO wrote:
Open the fixnames.pl script with a text editor (I use Notepad++). Change the value of prompt to "0".

Thanks !!! I forgot to try and open it with the notepad and look inside :( Simple solutions works wonders sometimes. I thought you need pearl editor or smth to do it.

Just done 4300 files in 15 sec ;) nice !

ChapeL
Last Edit: 6 years 5 months ago by ChapeL.
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 2 months ago #16985

  • reddevil
  • reddevil's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 4
  • Karma: 0
Hi malor89,

Thanks for the awesome scripts.

I have (just) one problem with 'fixnames.pl': I have folder named "Batman & Robin" and the script refuses to go inside that folder. Tried various combinations for naming the folder (just to check if other folders will be affected somehow) and got that the folder named "& bin" is not being entered inside. How can i overcome this (without renaming the folder) in 'fixnames.pl'? One more thing if i remove $RECYCLE.BIN from $skipdir, then the script works.

Regards.
Last Edit: 6 years 2 months ago by reddevil. Reason: new info
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 2 months ago #16987

  • malor89
  • malor89's Avatar
  • Offline
  • Senior Boarder
  • Posts: 73
  • Thank you received: 16
  • Karma: 17
reddevil,

You've done a pretty thorough job of testing. I didn't think about the implication of "$RECYCLE.BIN" starting with a dollar sign, which would cause it to be treated as an empty variable so "$RECYCLE.BIN" would become ".BIN" and a "." matches any single character. So pretty much any folder that ends in "bin" would match. Adding a "\" before "$RECYCLE.BIN" should fix the problem.

Short answer:
Replace $RECYCLE.BIN with \$RECYCLE.BIN

All the scripts that contain $RECYCLE.BIN will also need this fix.
Last Edit: 6 years 2 months ago by malor89.
The administrator has disabled public write access.
The following user(s) said Thank You: 600WPMPO

Re: malor89's Perl Scripts 6 years 2 months ago #17063

  • reddevil
  • reddevil's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 4
  • Karma: 0
Confirmed that the fix works.

Actually i was trying to self learn perl to do some routine tasks of mine. I still don't understand the syntax completely. I am using your scripts as a guide (i can't thank you enough), since they are so well written.

One more query: since 'corrupt' is in $skipdir, any folder which ends with 'corrupt' is being skipped. how to check if the complete folder name is 'corrupt' and nothing else.

Thanks again, malor89.
Last Edit: 6 years 2 months ago by reddevil. Reason: new info
The administrator has disabled public write access.

malor89's Perl Scripts 2 years 7 months ago #42159

  • AimHere
  • AimHere's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
Hi,

I found the testarchives.pl script here, and it's helpful for weeding out unreadable cbr/cbz files. However, I'm noticing that it doesn't find ALL corrupt archives.

I have a whole folder of comics which I ran testarchives.pl against, and it only caught maybe half of the truly corrupt files. The rest it passed over as if they were okay. Yet I either cannot open these files in ComicRack at all, or they open but many pages are missing or blank. (I've also tried other comic readers wit similar results.)

I believe what's happening is that when 7-zip tests these archives, it returns error messages that are not in the format testarchives.pl is expecting... therefore, the script assumes the archive is okay.

Here's a typical example of what I get if I run 7-zip manually to test one such archive:
7-Zip [64] 9.22 beta  Copyright (c) 1999-2011 Igor Pavlov  2011-04-18

Processing archive: 52 Week 051 (2007) (Digital).cbz


ERROR: An attempt was made to move the file pointer before the beginning of the
file.


Looking at testarchives.pl, it seems the script is looking for a substring "Sub items Errors:" to consider a file as corrupt, but as you can see above, this substring doesn't always exist in the 7-zip output. (FYI, testarchives.pl has caught a number of other corrupt archives for me, so it's just certain types of errors that it fails to catch.)

I haven't tried to modify the script myself (yet), since I don't know anything about Perl. Anyone have any ideas how to go about including errors like the one above as a failure condition in the script?
The administrator has disabled public write access.
Time to create page: 0.178 seconds

Who's Online

We have 241 guests and one member online