Snappy file in unix decompress using unix commands - snappy

how to decompress snappy format file in unix using unix commands. from Amazon s3 files are ftped to unix, i want to convert these files to orc format. can anyone help me with how to decompress snappy format file.

Related

My Java zipped file not supported in Junzip C program

I have written a Java program to zip files and to unzip them in an unzipping C program called Junzip.
https://github.com/jokkebk/JUnzip. I'm able to unzip the file using 7zip file extractor. But when using C Junzip, its not unzipping.
But when I'm unzipping the file, which was zipped using normal file compressor, I'm able to unzip it using the same jUnzip library.
Author of the JUnzip library here, just came across this question. Did I understand correctly that .zip files made by your program unzip correctly with 7zip, but not with JUnzip, whereas JUnzip seems to be able to uncompress .zip files made by others?
Without further info, it's hard to say if there's a .zip feature you are using that JUnzip does not support, or if there's a bug in JUnzip. One possible reason is that the library and junzip.exe only supports a limited set of compression methods, namely Deflate that is supported by zlib library it uses. The code base is rather small so you could probably add a few debug statements to see where it goes wrong.
You can check out https://codeandlife.com/2014/01/01/unzip-library-for-c/ for some details regarding JUnzip.

Can I use zlib to decompress microsoft office files which are actually just zip files?

I want to inflate Microsoft office files using the zlib library. From what I have read, office files are just zip files with extensions like docx,xlsx etc. The unzip utility can actually decompress the files. Can I do the same with the zlib library?
zlib provides the basic machinery needed to decompress deflate data and to compute CRCs, which is most of what you need to decode zip files. However zlib does not provide zip file format decoding, i.e. decoding the headers, which you would need to wrap around the zlib calls for decompression and check value computation.
zlib does come with minizip, which is in the contrib directory of the source distribution, to do that job. You can also look at libzip or libarchive, which use zlib and which provide zip file functions.
Indeed new office files are in fact .zip files. Not the old .doc and .xls but the new .docx and .xlsx. You can see that if you rename them to .zip and open them. You will then see the contents as .xml files.
A sample code would be something like
HZIP hz = OpenZip(AgentDLLZip, 0, ZIP_FILENAME);
ZIPENTRYW ze;
GetZipItemW(hz, 0, &ze);
UnzipItem(hz, 0, ze.name, 0, ZIP_FILENAME);
CloseZip(hz);
and just use few files you can find here.

How to open files in compressed format. ZFC

How I can open files in compressed format. ZFC in windows?
The format is this
http://file.downloadatoz.com/zfc-file-extension/
I'm trying to unzip this file
http://fluxxy.com.br/rom.zfc
Thanks to anyone who can help me!
This file format seems to be a proprietary format.
It contains no header related to well known archive format so you won't be able to uncompress ti unless you find an RFC-alike documentation.
You won't get through it easilysince you'll need binary mapping from Alistair to do so.

Read omni.jar archive file with MiniZip library

Firefox store its default configuration information in omni.jar (older version) or omni.ja (later versions). Both omni.jar and omni.ja just are zip file format. So we can use many programs/libraries to compress or decompress them.
I want to get some default information of Firefox. So I must read some file in those omni file. I have used 7zip program to see the content of omni or MiniZip/Zlib library to read omni in my program.
With later version, omni.ja, it is read well. But with older versions, MiniZip cannot open the omni.jar file. Then I use 7zip to open those file: omni.ja was ok, omni.jar was fail. But with some other program, ex: WinRar, WinZip, ... both omni file is opened well.
I was google and get some information: with older version, Firefox has created the omni.jar file (a zip file format) with no zip standard. blah blah. But why WinRar or WinZip can read.
Anyone can help me to get MiniZip read omni.jar file with no error?
Thank you very much.
The solution is pretty simple: Your "old" omni.jar is broken. My omni.jar starts with PK.
I suggest to download Firefox from the official archive once more.
[EDIT] It seems that different builds of Firefox use different tools to built the ZIP archive. The en-US version uses a ZIP-like format which doesn't start with PK. While in theory the file format is valid (it contains data followed by the list of entries), almost no tool really supports this format (so WinZIP and WinRAR are the exceptions).
This intention is reflected by the rename of omni.jar to omni.ja: It's not encrypted, it's just a ZIP format that isn't widely supported and the US Firefox developers don't want to change this.
The other developers (for example for the de version) use official tools to build the omni archive so those versions can be modified with any tool.
You will need to find a way to update the archive using WinZIP / WinRAR or you need to download the original firefox sources and add your patches to the build process.

Read and write directly from and to compressed files in C

in Java I think it is possible to cruise through jar files like they were not compressed. Is there some similar (and portable) thing in C/C++ ?
I would like to import binary data into memory from a large (zipped or similar) file without decompressing to disk first and afterwards writing to disk in a compressed way.
Maybe some trick with shell pipes and the zip utility?
I think you want zlib:
http://www.zlib.net/

Resources