Re: Using GZip decompression in VB 6
- From: "Stoil Marinov" <stoil_marinovOBVIOUS@xxxxxxxxxxx>
- Date: Fri, 30 Jun 2006 15:13:42 GMT
<flanaganseanie@xxxxxxxxx> wrote in message
news:1151650194.581082.295490@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Stoil Marinov wrote:
Hi Sean,
I use the gzip.exe utility, starting it from VB:
http://www.gzip.org/
Regards,
Stoil
Thanks Stoil,
Do you have any example code? I would be interested to see what the
parameters are.
Thanks
Sean
I do not have a stand alone sample code, sory.
I use two options only:
1. List the compressed file attributes.
2. Decompress the gzip file.
And here is how the Shell() command looks for each of these cases:
1. C:\WINNT\system32\cmd.exe /C D:\0000\gzip.exe -lv D:\0000\Test1.txt.gz >
D:\0000\Out.txt
2. C:\WINNT\system32\cmd.exe /C D:\0000\gzip.exe -dvf D:\0000\Test1.txt.gz >
D:\0000\Out.txt
In the above commands /C after the cmd.exe means for the Command promtp
window to close automatically after the program finishes.
D:\0000\Out.txt redirects the gzip.exe program output to a text file, somy program can read it.
Also, do not hardcode the path and name of the Command prompt EXE, if you
run your program on different platforms.
Use Environ$("Comspec") to get the correct path and name to the Command
prompt.
Since Shell() starts the program asynchronously, if you want to wait until
it has finished, check this link fo how it is done:
http://groups.google.com/group/comp.lang.basic.visual.misc/browse_frm/thread/a53f05064dda5044/2585ddd6918270a3?lnk=st&q=Re%3A+SHELL+stoil&rnum=5&hl=en#2585ddd6918270a3
There are two essential things to note:
- each .GZ archive containes only one file;
- when the file is decompressed, the original .GZ file is replaced by
the decompressed one which is renamed with the same name minus the .GZ
extension.
Taking the above into account, if you need to extract the .GZ file in
certain directory, you must first copy the .GZ file in that directory and
then extract it. Or you can extract it in whatever directory it is currently
and then copy the extracted file into the directory you need it to be.
There is no way for you to specify a directory where the extracted file
would go as you could with the unzip.exe utility.
Hope this helps.
Regards,
Stoil
.
- References:
- Using GZip decompression in VB 6
- From: flanaganseanie
- Re: Using GZip decompression in VB 6
- From: Stoil Marinov
- Re: Using GZip decompression in VB 6
- From: flanaganseanie
- Using GZip decompression in VB 6
- Prev by Date: Re: Cant resolve If or Elseif statements
- Next by Date: Re: Sorting arrays
- Previous by thread: Re: Using GZip decompression in VB 6
- Next by thread: 'Please wait while Windows configures Microsoft Platform SDK (R2)'
- Index(es):
Relevant Pages
|
Loading