WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> Bug Reports >> UnZip
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1205217661

Message started by shawnmullen on Mar 11th, 2008 at 8:41am

Title: UnZip
Post by shawnmullen on Mar 11th, 2008 at 8:41am
I am evaluating watchDirectory.  I am not sure this is a bug.  When a file is unzipped it's file attribute is set to read-only.  How do you prevent this?

Title: Re: UnZip
Post by Gert on Mar 11th, 2008 at 12:12pm
Hello Shawn,

I just did a few tests and can not really reproduce this. I am assuming you really mean the read-only attribute, and not the "file security" attributes..
If you *do* mean the security attributes (shows when you right-click the file, properties, security), you should make sure the "file security" window of your task is set to "Allow Everyone" (see attached picture).

Gert
filesec.png (28 KB | )

Title: Re: UnZip
Post by shawnmullen on Mar 11th, 2008 at 6:03pm
I am not talking about the file security setting.  I am talking about the file attribute (ex. Read-Only, Hidden, etc).  When watchDirectory unzips a file the files being written onto the disk have their Read-Only attribute set to true.

Title: Re: UnZip
Post by shawnmullen on Mar 12th, 2008 at 4:51am
Any ideas?  If watchDirectory does not work, I'll have to develop my own solution and I really don't want to.

Thanks.

Title: Re: UnZip
Post by Gert on Mar 12th, 2008 at 8:31am
Hi,

Like I said, I am not able to reproduce this currently.
Can you please "right click" the task while it is not running, and select "backup selected task". Please send the backup and an example ZIP file that causes the problem to me (gert at watchdirectory.net).

Gert

Title: Re: UnZip
Post by shawnmullen on Mar 12th, 2008 at 3:58pm
Here it is.  I don't have small enough pdf to send in this zip file.  However, I am not sure it matters.  If I unzip the file with the pdf in it using PKZip, the readonly attribute is not set to true.  If watchDirectory unzips the same zip file containing the same pdf, the pdf file's readonly attribute is set to true.

modified by Gert: removed the zip from your post

Title: Re: UnZip
Post by Gert on Mar 12th, 2008 at 8:24pm
Okay, I have tried it with your task (I removed it from your post again).
When I put a zip in the folder, the unzipped file has no read-only attribute, even when it has a read-only attribute inside the zip...
Perhaps there is some other process setting the read-only attribute?

Alternatively, you can use your pkzip's commandline option with the "automatically run a bat file" task to do the unzipping.
I am not sure about the commandline of pkzip, but I guess you call it something like this:
[code]
"c:\program files\pkware\pkzip.exe" -unzip "%WD_FILE%" -directory "%WD_FILE_D%"
[/code]
(-unzip and -directory are switches made up by me, check your pkzip documentation)
%WD_FILE% is an environment variable that contains the full path of the detected file (the zip)
%WD_FILE_D% has just the directoryname where the zip is found.
Other variables are here: http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBatEnv.html

Gert

Title: Re: UnZip
Post by shawnmullen on Mar 14th, 2008 at 9:32pm
I finally figured it out.  I am using SharpZipLib to zip the files.  The current version uses Zip64 extensions and it has this feature turned on by default.  Once I turned it off, watchDirectory was able to properly unzip the file.  This may be a good thing to add for a future release.  watchDirectory needs to be able to inturpret zip64 extensions properly.

Thanks again for all your help.

Title: Re: UnZip
Post by Gert on Mar 15th, 2008 at 12:01am
Can't say I have heard of SharpZipLib or zip64 before, but thanks for letting me know.

One of our previous releases made a switch from ZLIB to Chilkat for the ZIP component (mostly because Chilkat supports encryption). We plan to also switch to Chilkat  for our unzip component, not sure if that will help, but I hope it will.

Glad you have found a work-around.

Gert

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.