You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gzip.uncompress() to original_file_name from gzip metadata #120
What I'm asking is for something akin to gzip --decompress--name \ -N, or in other words to be able to supply compressing.gzip.uncompress() with a directory name like compressing.zip.uncompress()
Here's an example:
bash:
echo"console.log('hi')"> script.js
gzip script.js
mv script.js.gz output.gz
ls
# output.gz
gzip --decompress --keep --name output.gz
ls
# output.gz# script.js
js:
// [1] Cant uncompress into a dir unlike the gzip clicompressing.gzip.uncompress('output.gz','./result');// node error "open EISDIR"// [2] Cant reliably uncompress into a file unless you know the file name inside the gzipcompressing.gzip.uncompress('output.gz','./result/output');// ok but you just lost the original filename and extension// [3] Can only reliably uncompress if you already know the filename inside the gzipcompressing.gzip.uncompress('output.gz','./result/script.js');// ok but i might not know the name and extension of the gzipped file
Ideally compressing.gzip.uncompress() should be able to accept a dir path like in example [1] - and then automatically get the output file name from:
(if FLG.FNAME set) original_file_name
(If FLG.FNAME not set) archive_name.replace(/\.gz$/, "");
(Might need a better idea for streams and buffers)
Activity
fengmk2 commentedon Dec 3, 2025
Can you provide a way to reproduce it?
Araxeus commentedon Dec 4, 2025
What I'm asking is for something akin to
gzip --decompress--name \ -N, or in other words to be able to supplycompressing.gzip.uncompress()with a directory name likecompressing.zip.uncompress()Here's an example:
bash:
js:
Ideally
compressing.gzip.uncompress()should be able to accept a dir path like in example [1] - and then automatically get the output file name from:FLG.FNAMEset)original_file_nameFLG.FNAMEnot set)archive_name.replace(/\.gz$/, "");(Might need a better idea for streams and buffers)
[-]gzip uncompress file name[/-][+]`gzip.uncompress()` to `original_file_name` from gzip metadata[/+]fengmk2 commentedon Dec 4, 2025
I understand that we need to parse the hidden default filename inside the gzip file.
This is a feature worth trying to implement.
You are welcome to participate in open source contributions through pull requests.