| |
 |
|
|
Science Forum Index » Compression Forum » I wanna decompress a *.gz file
Page 1 of 1
|
| Author |
Message |
| herrmie@googlemail.com |
Posted: Tue Mar 18, 2008 11:14 pm |
|
|
|
Guest
|
Hello,
I wanna decompress a *.gz file. And I get the data from the file but I
don't get the filename. I read the Specification RFC1952 but I come to
no solution. I need the bitposition, where the filename is set.
I hope that someone understand me. ;)
Thanks for help!!!
bye
herrmie |
|
|
| Back to top |
|
| herrmie@googlemail.com |
Posted: Tue Mar 18, 2008 11:53 pm |
|
|
|
Guest
|
On 19 Mrz., 10:43, Thomas Richter <t...@math.tu-berlin.de> wrote:
Quote: herr...@googlemail.com schrieb:
Hello,
I wanna decompress a *.gz file. And I get the data from the file but I
don't get the filename. I read the Specification RFC1952 but I come to
no solution. I need the bitposition, where the filename is set.
.gz files are not archives, they don't contain "files". They only
represent a stream of bytes. The file name isn't stored anywhere because
that's beyond the purpose of .gz.
Typically, the "original" file name is what you get if you strip off the
.gz ending.
That said, there is no bit position where the file name is stored.
So long,
Thomas
Hello Thomas,
thanks for your help. But can I get the Filetime of the file stored in
the .gz file?
Bye Steffen |
|
|
| Back to top |
|
| Mark Adler |
Posted: Wed Mar 19, 2008 3:05 am |
|
|
|
Guest
|
On Mar 19, 2:14 am, "herr...@googlemail.com" <herr...@googlemail.com>
wrote:
Quote: I read the Specification RFC1952 but I come to
no solution. I need the bitposition, where the filename is set.
Well, you should read it again. It's pretty clear.
The original file name may or may not be stored in the gzip header.
The FLG byte has a bit FNAME that if set indicates that the file name
is stored after the ten byte header as a zero-terminated string.
However if the FEXTRA bit is also set, then the file name is preceded
by an extra field that has to be skipped (it starts with two bytes
that contains the length of the remainder of the extra field, least
significant byte first), and the zero-terminated file name will follow
that.
Typically if gzip was run directly on a file, then the file name is
stored in the header. If gzip was piped data to be compressed, e.g.
if a tar file was generated on the fly and fed to gzip, then no file
name is stored in the header.
Mark |
|
|
| Back to top |
|
| Thomas Richter |
Posted: Wed Mar 19, 2008 4:43 am |
|
|
|
Guest
|
herrmie@googlemail.com schrieb:
Quote: Hello,
I wanna decompress a *.gz file. And I get the data from the file but I
don't get the filename. I read the Specification RFC1952 but I come to
no solution. I need the bitposition, where the filename is set.
..gz files are not archives, they don't contain "files". They only
represent a stream of bytes. The file name isn't stored anywhere because
that's beyond the purpose of .gz.
Typically, the "original" file name is what you get if you strip off the
..gz ending.
That said, there is no bit position where the file name is stored.
So long,
Thomas |
|
|
| Back to top |
|
| Phil Carmody |
Posted: Wed Mar 19, 2008 5:38 am |
|
|
|
Guest
|
"herrmie@googlemail.com" <herrmie@googlemail.com> writes:
Quote: On 19 Mrz., 10:43, Thomas Richter <t...@math.tu-berlin.de> wrote:
herr...@googlemail.com schrieb:
Hello,
I wanna decompress a *.gz file. And I get the data from the file but I
don't get the filename. I read the Specification RFC1952 but I come to
no solution. I need the bitposition, where the filename is set.
.gz files are not archives, they don't contain "files". They only
represent a stream of bytes. The file name isn't stored anywhere because
that's beyond the purpose of .gz.
Typically, the "original" file name is what you get if you strip off the
.gz ending.
That said, there is no bit position where the file name is stored.
Hello Thomas,
thanks for your help. But can I get the Filetime of the file stored in
the .gz file?
No re-read what Thomas said. In particular his very first sentence.
Phil
--
Dear aunt, let's set so double the killer delete select all.
-- Microsoft voice recognition live demonstration |
|
|
| Back to top |
|
| Hans-Peter Diettrich |
Posted: Wed Mar 19, 2008 10:00 am |
|
|
|
Guest
|
herrmie@googlemail.com wrote:
Quote: I wanna decompress a *.gz file. And I get the data from the file but I
don't get the filename. I read the Specification RFC1952 but I come to
no solution. I need the bitposition, where the filename is set.
When you compress file x.y, it becomes x.y.gz.
When you uncompress x.y.gz, name the result x.y again.
DoDi |
|
|
| Back to top |
|
| |
|
Page 1 of 1
All times are GMT - 5 Hours
The time now is Mon Sep 08, 2008 1:04 am
|
|