Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / June 2006



Tip: Looking for answers? Try searching our database.

Using GZip decompression in VB 6

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
flanaganseanie@gmail.com - 29 Jun 2006 22:17 GMT
Please note this request is also posted to the group:
microsoft.public.vb.general.discussion.

I am looking for a way to add gzip support to a VB6 Application.  I
have written an application that contains .zip support an dhave been
informed that .gz support is also required.

i would be most grateful for any pointers

regards

Sean
Rick Rothstein - 29 Jun 2006 22:28 GMT
> Please note this request is also posted to the group:
> microsoft.public.vb.general.discussion.

The proper way to do this is to list both newsgroups in the newsgroups field
separated by a comma. That way, the message is posted to both groups at the
same time. But more importantly, anyone answering you from one newsgroup
will have their answer automatically appear in both groups. This allows
anyone visiting either newsgroup to see the complete discussion. That way,
someone wanting to help you in one newsgroup won't waste their time creating
an answer that has already been given to you in the other newsgroup. It also
means that someone from one newsgroup can comment on, or improve upon, an
answer given to you by someone else from either newsgroup. This is a win-win
situation for those who volunteer giving answers on newsgroups and for you
as well (you get the most complete set of comments possible).

Rick
flanaganseanie@gmail.com - 30 Jun 2006 07:46 GMT
> > Please note this request is also posted to the group:
> > microsoft.public.vb.general.discussion.
[quoted text clipped - 12 lines]
>
> Rick

Thanks Rick,

I was under the impression that it was bad manners to send the same
message to both newsgroups.

Sean
Dag Sunde - 30 Jun 2006 09:02 GMT
>>> Please note this request is also posted to the group:
>>> microsoft.public.vb.general.discussion.
[quoted text clipped - 19 lines]
> I was under the impression that it was bad manners to send the same
> message to both newsgroups.

The terms are "multipost" vs. "Crosspost".

* To post the same message to different NGs separately is *BAD*
* To post a single message to several (appropriate) NGs
 simultaneously is *GOOD*

:-)

Signature

Dag.

Stoil Marinov - 29 Jun 2006 22:35 GMT
Hi Sean,

I use the gzip.exe utility, starting it from VB:
http://www.gzip.org/

Regards,

Stoil

> Please note this request is also posted to the group:
> microsoft.public.vb.general.discussion.
[quoted text clipped - 8 lines]
>
> Sean
flanaganseanie@gmail.com - 30 Jun 2006 07:49 GMT
> Hi Sean,
>
[quoted text clipped - 4 lines]
>
> Stoil

Thanks Stoil,

Do you have any example code?   I would be interested to see what the
parameters are.

Thanks

Sean
Stoil Marinov - 30 Jun 2006 16:13 GMT
> > Hi Sean,
> >
[quoted text clipped - 13 lines]
>
> 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, so
my 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/a53
f05064dda5044/2585ddd6918270a3?lnk=st&q=Re%3A+SHELL+stoil&rnum=5&hl=en#2585ddd69
18270a3


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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.