devsnd / tarindexer

python module for indexing tar files for fast access
GNU General Public License v3.0
74 stars 15 forks source link

Indexing TAR archive on tape. #6

Open lawndartdeath opened 7 years ago

lawndartdeath commented 7 years ago

Hi, I tried to use your script to index the contents of a tar archive on a magnetic tape with the following command.

sudo ./tarindexer.py -i /dev/st0 tape.index

Which gives me this error.

One dot stands for 1000 indexed files. Traceback (most recent call last): File "./tarindexer.py", line 123, in <module> main() File "./tarindexer.py", line 118, in main indextar(dbtarfile,indexfile) File "./tarindexer.py", line 71, in indextar if(currentseek/filesize>lastpercent): ZeroDivisionError: division by zero

I'm guessing this just isn't supported. Any ideas? Thanks!

devsnd commented 7 years ago

Hey Joseph,

Thanks for your report! I never tried indexing a real tape using the program, but it might work indeed. It seems the tape device reports its own size as 0, which makes the program crash.

You could try to comment out these lines: https://github.com/devsnd/tarindexer/blob/master/tarindexer.py#L71-L80 (by putting a # in front of each line)

The program would then no longer report its progress, but should not crash anymore.