Comments (10)
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.
Okay, this is finally done. Sorry for the delay!
from gopar.
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.
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.
(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.
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:
- the error message is confusing since it doesn't mention file not found at all, and
- 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.
A, so the parity file is relative to the data files? (That is opposite from par2cmdline, hence me running into it.)
from gopar.
I think my intention is to match whatever par2cmdline is doing 😅
from gopar.
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.
@akalin Do you think you'll have some time for this?
from gopar.
Related Issues (8)
- Command line options not accepted HOT 3
- Return values. HOT 11
- panic: unexpected ID string HOT 15
- libgopar HOT 3
- [bug] Creating new parity files: "panic: too many shards" HOT 9
- Memory usage very high HOT 2
- UTF8 rather than ASCII HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gopar.