How to compress folders into ext4 in Windows? - ext4

I wanted to compress a file into an img file in ext4 format, but I couldn't find the corresponding tool under Windows.

Related

How to compress a .json file into .json.gz file format in c++?

I compressed a json string in gzipped format.
But I want to compress a .json file into .json.gz file format.
How can I do that in c++?
I could compress a file into .gz file in cpp that I needed.
Used linux terminal command for file gzip
char Command[] = "gzip filepath/filename.json";
Then executed the command in code by using
int sysRet = system(Command);
Then in device storage desired filepath filename.json.gz file will be created.

How can you read select few files from a tar file in s3 without having to download the tar?

You do not want to download the tar file.
Just download select few files inside the tar.
Does s3 provide any API to do this or is Apache Commons Compress my best bet?
While you'll be able to stream the file from S3 you'll still basically download it. The Apache Commons Compress library will help hide some of this and is a good solution. The other option would be to store the individual files in the tar file so that they can be randomly accessed.

Compression is not working in ZLib library

I want to zip a already existing file in a directory, I am calling deflate method
int def(FILE *source, FILE *dest, int level) of ZLib library and I'm getting zipped file (making a file with .zip extension), but the problem is when I'm trying to unzip it by double clicking, I'm getting corrupted file though the return value is Z_OK.
PS: want to compress file not data. Any Help???
zlib does not produce the zip format. You would need to generate your own zip headers and trailers around the deflate compressed data produced by zlib.

gsutil finding the uncompressed file size

Is there a way to get the uncompressed file size using gsutils? I've looked into du and ls -l. Both return the compressed size. I would like to avoid having to download the files to see their size.
gsutils provides only some basic commands like copy, list directory files etc. I would like to suggest you to write a python scripts which let you know the original size of the zipped files.

How should you write the prep stage when the source file is a .gz?

The setup macro cannot handle a .gz file. I think I should extract the source .gz file without deleting it (decompressing with gzip deletes the file normally), and then manually cd into the uncompressed directory.
I am wondering if this is a good solution.
You cannot extract a directory from just a .gz file. That would be a .tar.gz file. The extraction of a .tar.gz file does not normally delete the .tar.gz file.