Giter Club home page Giter Club logo

Comments (10)

akalin avatar akalin commented on July 19, 2024 1

I can try looking at this next weekend -- I'd have to refresh my memory but it doesn't seem too difficult. We'll see! :)

from gopar.

akalin avatar akalin commented on July 19, 2024 1

Okay, this is finally done. Sorry for the delay!

from gopar.

akalin avatar akalin commented on July 19, 2024

Can you give steps to repro? I just tried it and it seems to work for me:

> mkdir testdir
> head -c 1M </dev/urandom >testdir/testfile
> par c test.par2 testdir/testfile
[1/1] Loaded data file "testdir/testfile" (1048576 bytes)
Wrote index file "test.par2" (10880 bytes)
[0+1/3] Wrote recovery file "test.vol00+01.par2" (2068 data bytes, 12948 bytes)
[1+2/3] Wrote recovery file "test.vol01+02.par2" (4136 data bytes, 15016 bytes)
> par v test.par2
Loaded creator packet with client ID "gopar"
Loaded main packet: slice byte count=2000, recovery set size=1, non-recovery set size=0
Loaded file description packet for "testdir/testfile" (ID=2c17fe813d1d8facd0a8aff8eca5ace4, 1048576 bytes)
Loaded checksums for file with ID 2c17fe813d1d8facd0a8aff8eca5ace4
[1/1] Loaded data file "testdir/testfile" (1048576 bytes, 525 hits, 0 misses)
Loaded recovery packet: exponent=0, byte count=2000
[1] Loaded volume file "test.vol00+01.par2"
Loaded recovery packet: exponent=1, byte count=2000
Loaded recovery packet: exponent=2, byte count=2000
[2] Loaded volume file "test.vol01+02.par2"

from gopar.

akalin avatar akalin commented on July 19, 2024

btw, the abspath check (and a bunch of other checks) are there to avoid having to write a bunch of filepath-handling code. when i stopped working on this, this project was still very much in the initial experimental stages. 😅

from gopar.

brenthuisman avatar brenthuisman commented on July 19, 2024
(base) [09:22:46 last:0s ~/tmp/par] stat wow/nsa.tar.zst 
  Bestand: wow/nsa.tar.zst
  Grootte: 80971785     Blokken: 158152       IO-blok: 4096   normaal bestand
Apparaat: 23h/35d   Inode: 6233046      Koppelingen: 1
Toegang: (0664/-rw-rw-r--)   UID: ( 1000/   brent)   GID: ( 1000/   brent)
Context:   unconfined_u:object_r:user_tmp_t:s0
Toegang:   2021-01-17 20:03:17.941465179 +0100
Gewijzigd: 2020-12-29 16:44:42.000000000 +0100
Veranderd: 2021-01-17 20:03:16.730464903 +0100
Ontstaan:  -

(base) [09:23:08 last:1s ~/tmp/par] /home/brent/sync/code/gopar/main c -s 100000 wow/nsa.tar.zst.par2 wow/nsa.tar.zst
[1/1] Loaded data file "wow/nsa.tar.zst" (80971785 bytes)
Wrote index file "wow/nsa.tar.zst.par2" (16580 bytes)
[0+1/3] Wrote recovery file "wow/nsa.tar.zst.vol00+01.par2" (100068 data bytes, 116648 bytes)
[1+2/3] Wrote recovery file "wow/nsa.tar.zst.vol01+02.par2" (200136 data bytes, 216716 bytes)

(base) [09:23:25 last:0s ~/tmp/par] /home/brent/sync/code/gopar/main v wow/nsa.tar.zst.par2 wow/nsa.tar.zst
Loaded creator packet with client ID "gopar"
Loaded main packet: slice byte count=100000, recovery set size=1, non-recovery set size=0
Loaded file description packet for "wow/nsa.tar.zst" (ID=06ed1e3c84c5adbd9e3d7b7b2cce7a57, 80971785 bytes)
Loaded checksums for file with ID 06ed1e3c84c5adbd9e3d7b7b2cce7a57
[1/1] Loaded data file "wow/nsa.tar.zst" (0 bytes, 0 hits, 0 misses)
Corrupt data chunk: "wow/nsa.tar.zst" (ID 06ed1e3c84c5adbd9e3d7b7b2cce7a57), bytes 0 to 80971784
Corrupt data chunk: "wow/nsa.tar.zst" (ID 06ed1e3c84c5adbd9e3d7b7b2cce7a57), bytes 0 to 80971784
Loaded recovery packet: exponent=0, byte count=100000
[1] Loaded volume file "wow/nsa.tar.zst.vol00+01.par2"
Loaded recovery packet: exponent=1, byte count=100000
Loaded recovery packet: exponent=2, byte count=100000
[2] Loaded volume file "wow/nsa.tar.zst.vol01+02.par2"
Repair necessary but not possible.

from gopar.

akalin avatar akalin commented on July 19, 2024

Ah, I see the problem -- the file path in the .par2 is wow/nsa.tar.zst, so gopar is trying to look up wow/nsa.tar.zst from wow. So:

  1. the error message is confusing since it doesn't mention file not found at all, and
  2. the par2 creation should compute the relative paths from the output .par2 file.

I think I was always testing by creating the .par2 file in the current directory, even though the other files might be in various subdirs. So that would be the workaround while I fix the above.

from gopar.

brenthuisman avatar brenthuisman commented on July 19, 2024

A, so the parity file is relative to the data files? (That is opposite from par2cmdline, hence me running into it.)

from gopar.

akalin avatar akalin commented on July 19, 2024

I think my intention is to match whatever par2cmdline is doing 😅

from gopar.

brenthuisman avatar brenthuisman commented on July 19, 2024

Actually, this is one of the things that's not great about par2cmdline, and is quite brittle when you start using par2cmdline's basepath flag.

My preferred way to handle would be to take the input files relative to the parity file (we are checking a parity file, not a file-file ;)). (par2cmdline says it does this, but that's actually not quite true and that part you should definitively not copy ;))

( My second preferred way would be to not store/handle changes in filepaths at all anyway, such that the parity files can be moved without causing it to suggest recovery (by moving the file back to the relative position at creation time). It would only check the bitstreams, nothing else. You could then pass absolute paths without running into problems. But that might run against some peoples understanding of the spec/default behavior. )

from gopar.

brenthuisman avatar brenthuisman commented on July 19, 2024

@akalin Do you think you'll have some time for this?

from gopar.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.