Quickie: what is a file that starts with these bytes?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Quickie: what is a file that starts with these bytes?
Now i have this binary file that should be some sort of patch (for a project file tree, not for a single file in it), but i do not know what to do with it. It is offered do download without extension - which lead me to test it with a few extract commands: bzip, xz, gzip, tar.
A few lines from my terminal should be informative:
Do you know what that file header is, or how to find it with that info?
(xz starting bytes have "7z" written... do they have the same format that 7zip uses?)
-------
Post "mark as solved" note: this thread is marked as solved, since its title question and problem have been answered. But there are other things still without answer. They are listed in the post #22.
But i am not understanding, by reading its manpage, what i have to do with the patch file, and the project tree (or its compated file).
Hints? /-:
The manpage is:
Code:
XDELTA3(1) General Commands Manual XDELTA3(1)
NAME
xdelta3 - VCDIFF (RFC 3284) binary diff tool
SYNOPSIS
xdelta3 [command] [options] [input [output]]
DESCRIPTION
xdelta3 is a binary diff tool that uses the VCDIFF (RFC 3284) format
and compression.
COMMANDS
config prints xdelta3 configuration
decode decompress the input, also set by -d
encode compress the input, also set by -e (default)
test run the builtin tests
printdelta
print information about the entire delta
printhdr
print information about the first window
printhdrs
print information about all windows
recode encode with new application/secondary settings
OPTIONS
standard options:
-0 .. -9
compression level
-c use stdout
-d decompress
-e compress
-f force overwrite
-h show help
-q be quiet
-v be verbose (max 2)
-V show version
memory options:
-B bytes source window size
-W bytes input window size
-P size compression duplicates window
-I size instruction buffer size (0 = unlimited)
compression options:
-s source source file to copy from (if any)
-S [djw|fgk|lzma|none]
enable/disable secondary compression
-N disable small string-matching compression
-D disable external decompression (encode/decode)
-R disable external recompression (decode)
-n disable checksum (encode/decode)
-C soft config (encode, undocumented)
-A [apphead]
disable/provide application header (encode)
-J disable output (check/compute only)
-T use alternate code table (test)
NOTES
The XDELTA environment variable may contain extra args:
XDELTA="-s source-x.y.tar.gz" \
tar --use-compress-program=xdelta3 -cf \
target-x.z.tar.gz.vcdiff target-x.y/
EXAMPLES
Compress the differences between SOURCE and TARGET, yielding OUT, using
"djw" secondary compression:
xdelta3 -S djw -s SOURCE TARGET OUT
Do the same, using standard input and output:
xdelta3 -S djw -s SOURCE < TARGET > OUT
To decompress OUT, using SOURCE, yielding TARGET:
xdelta3 -d -s SOURCE OUT TARGET
AUTHOR
xdelta3 was written by Josh MacDonald <josh.macdonald@gmail.com>.
This manual page was written by Leo 'costela' Antunes
<costela@debian.org> for the Debian project (but may be used by oth‐
ers).
Xdelta3 August 2009 XDELTA3(1)
But i am not understanding, by reading its manpage, what i have to do with the patch file, and the project tree (or its compated file).
Hints? /-:
The manpage is:
Code:
XDELTA3(1) General Commands Manual XDELTA3(1)
NAME
xdelta3 - VCDIFF (RFC 3284) binary diff tool
SYNOPSIS
xdelta3 [command] [options] [input [output]]
DESCRIPTION
xdelta3 is a binary diff tool that uses the VCDIFF (RFC 3284) format
and compression.
COMMANDS
config prints xdelta3 configuration
decode decompress the input, also set by -d
encode compress the input, also set by -e (default)
test run the builtin tests
printdelta
print information about the entire delta
printhdr
print information about the first window
printhdrs
print information about all windows
recode encode with new application/secondary settings
OPTIONS
standard options:
-0 .. -9
compression level
-c use stdout
-d decompress
-e compress
-f force overwrite
-h show help
-q be quiet
-v be verbose (max 2)
-V show version
memory options:
-B bytes source window size
-W bytes input window size
-P size compression duplicates window
-I size instruction buffer size (0 = unlimited)
compression options:
-s source source file to copy from (if any)
-S [djw|fgk|lzma|none]
enable/disable secondary compression
-N disable small string-matching compression
-D disable external decompression (encode/decode)
-R disable external recompression (decode)
-n disable checksum (encode/decode)
-C soft config (encode, undocumented)
-A [apphead]
disable/provide application header (encode)
-J disable output (check/compute only)
-T use alternate code table (test)
NOTES
The XDELTA environment variable may contain extra args:
XDELTA="-s source-x.y.tar.gz" \
tar --use-compress-program=xdelta3 -cf \
target-x.z.tar.gz.vcdiff target-x.y/
EXAMPLES
Compress the differences between SOURCE and TARGET, yielding OUT, using
"djw" secondary compression:
xdelta3 -S djw -s SOURCE TARGET OUT
Do the same, using standard input and output:
xdelta3 -S djw -s SOURCE < TARGET > OUT
To decompress OUT, using SOURCE, yielding TARGET:
xdelta3 -d -s SOURCE OUT TARGET
AUTHOR
xdelta3 was written by Josh MacDonald <josh.macdonald@gmail.com>.
This manual page was written by Leo 'costela' Antunes
<costela@debian.org> for the Debian project (but may be used by oth‐
ers).
Xdelta3 August 2009 XDELTA3(1)
Nonono... forget that, for a few minutes, at least... the examples in the end should contain one with exactly what i need. What was confusing me is the command line options only talk about compress and decompress, and i was looking for diffs and comparisons things...
Edit:
Now that I think about it, I've gotten this confused with
bdiff and bpatch
I thought that was the right example too. But i am lost, and could not get it to work.
I have these files (with artificial comments i write only here):
Code:
$ ls
bacana-x11-1.2.tar.bz2 # the project source
bacana-x11-1.2 # project folder containing everything in the above file
patch-bacana-x11-1.2 # the path file that lead me to start this thread
$
I tried these:
Code:
$ # xdelta3 -d -s [patch file] [proj folder name] [unexistent file/dir name]
xdelta3: not a VCDIFF input: XD3_INVALID_INPUT
xdelta3: normally this indicates that the source file is incorrect
xdelta3: please verify the source file with sha1sum or equivalent
$ # xdelta3 -d -s [proj folder name] [patch file] [unexistent file/dir name]
xdelta3: input read failed: qt-x11-free-3.3.8: Is a directory
$ # xdelta3 -d -s [patch file] [project bz2 file] [unexistent file/dir name]
xdelta3: externally compressed input: bzip2 -dc < [unexistent file/dir name]
xdelta3: WARNING: the encoder is automatically decompressing the input file;
xdelta3: WARNING: the decoder will automatically recompress the output file;
xdelta3: WARNING: this may result in different compressed data and checksums
xdelta3: WARNING: despite being identical data; if this is an issue, use -D
xdelta3: WARNING: to avoid decompression and/or use -R to avoid recompression
xdelta3: WARNING: and/or manually decompress the input file; if you know the
xdelta3: WARNING: compression settings that will produce identical output
xdelta3: WARNING: you may set those flags using the environment (e.g., GZIP=-9)
xdelta3: not a VCDIFF input: XD3_INVALID_INPUT
xdelta3: normally this indicates that the source file is incorrect
xdelta3: please verify the source file with sha1sum or equivalent
$
I am not in the right path, probably... /-: Should i use the tar file?
I wonder what software you are trying to binary-patch there.
It just seems wrong to any self-respecting FLOSS user, and I immediately ask myself what the end goal is and if there aren't much better solutions to achive it...
I wonder what software you are trying to binary-patch there.
It just seems wrong to any self-respecting FLOSS user, and I immediately ask myself what the end goal is and if there aren't much better solutions to achive it...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.