WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
unzipping gunzip (Read 9967 times)
satisfactionsap
YaBB Newbies
*
Offline



Posts: 6
unzipping gunzip
Jun 28th, 2006 at 4:44pm
 
Hi

Can watchdirectory unzip files with .gz extentions. (gunzip files)

Thanks
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: unzipping gunzip
Reply #1 - Jun 29th, 2006 at 5:24am
 
Hi,

At the moment, WD (the AutoUnzip plugin) does not directly support .gz files. However, if you use the "automatically run a .bat file" plugin, and have a commandline decompressor for .gz files, it should be easy enough to support it.
Do you have a url for a commandline gz uncompress tool, then I will create a script for you?

Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
satisfactionsap
YaBB Newbies
*
Offline



Posts: 6
Re: unzipping gunzip
Reply #2 - Jul 3rd, 2006 at 5:52am
 
hi gert

the url i have it http://www.gzip.org/ it has lots of info.
If this works ie. if the wd can automatically unzip .gz files then i want to buy the software...because i need to use it for a longer period of time...on one of my projects..

thanks
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: unzipping gunzip
Reply #3 - Jul 4th, 2006 at 12:25am
 
Okay,

Try the following .bat file
Code:
SET TARGETDIR=D:\Target
SET TARGETDRIVE=D:
SET GZ=E:\Bin\gzip.exe

rem create the target directory, in case it doesn't exist yet
MD "%TARGETDIR%"
rem if the gz file was found in a directory below the monitored dir create a corresponding sub-directory
IF "%WD_RELDIR%" NEQ "" (
  TARGETDIR=%TARGETDIR%\%WD_RELDIR%
	MD "%TARGETDIR%"
)

rem create a sub-directory with the same base-name as the gz file
SET TARGETDIR=%TARGETDIR%\%WD_FILE_N%
MD "%TARGETDIR%"
rem make the target drive and directory current
"%TARGETDRIVE%"
CD "%TARGETDIR%"

rem unzip the new file
"%GZ%" -d "%WD_FILE%"
 



make the needed changes to the first 3 lines (where to find gzip.exe and where to uncompress the files).

Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
satisfactionsap
YaBB Newbies
*
Offline



Posts: 6
Re: unzipping gunzip
Reply #4 - Jul 5th, 2006 at 4:55am
 
Hi Gert

I am a bit confused. Do i have to make changes in the watchDirectory\plugins\wdopAutoRunBat\templates directory.
PLease explain more to me please.

cheers
Back to top
 
 
IP Logged
 
satisfactionsap
YaBB Newbies
*
Offline



Posts: 6
Re: unzipping gunzip
Reply #5 - Jul 5th, 2006 at 5:16am
 
Hi once again

There are 3 types of files in the "\watchDirectory\plugins\wdopAutoRunBat\templates" directory. Can you please advise me if i have to make some changes here. ALso there is a "\watchDirectory\plugins\wdopAutoUnzip" directory, is there any changes to ba made here...also when using the wizard in the "new task" which option should i choose to decompress the .gz files. Is it still:
"Automatically decompress ZIP files"? Please help me here. WHere does the code you gave me go exactly and what name should the batch file be?

Thanks
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: unzipping gunzip
Reply #6 - Jul 5th, 2006 at 9:32am
 
Sorry for the confusion.
You should create a file called AutoUngzip.bat (the extension IS important) using a text editor (notepad), save it anywhere you like on the local computer (not on a network). For example C:\Bin\AutoUngzip.bat.

Now create a new watchDirectory task and use the "Automatically run an existing .bat file" plugin (see http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBat.html ), and select the C:\Bin\AutoUngzip.bat.

Does that make sense?

Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
satisfactionsap
YaBB Newbies
*
Offline



Posts: 6
Re: unzipping gunzip
Reply #7 - Jul 6th, 2006 at 6:55am
 
HI gert

sorry stupid me...i overlooked that the code you gave me has to be modified to set a target folder...it all works fine but for the main problem...wd is not able to unzpi the .gz file but just creates a folder in the targer dir but does not actually have the file in it.
its a .dat file which is gzipped. but there is not .dat file in the folder.

cheers
Back to top
 
 
IP Logged
 
satisfactionsap
YaBB Newbies
*
Offline



Posts: 6
Re: unzipping gunzip
Reply #8 - Jul 6th, 2006 at 7:33am
 
hi gert

after looking at the wd log file

the get the following error.


"...\gzipd\xxx.dat.gz:no such file or dir", where xxx is the file name to be uncompressed and gzipd is the folder that is trigerred.
for the dir which is being watched by wd.

i think its to do with the gunzip part of the code.

also i have downloaded a gzip.exe from the following site:
http://www.stallion.com.au/html/download/utilities.html

and the gzip.exe file is stored in c:\Bin


however when i use gzip32.exe it works but the file is unzipped and replaces the zipped file in the source dir (wd dir which is being watched) and in the target dir, only a folder is created with the same name. There is no file inside it.


thanks

Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: unzipping gunzip
Reply #9 - Jul 6th, 2006 at 10:23am
 
Can you send me the .dat.gz file so I can experiment with it? See my signature for my email address.

Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Page Index Toggle Pages: 1