[delphizip] Re: Zip Disappears midway

  • From: James Turner <james.d.h.turner@xxxxxxxxxxxx>
  • To: delphizip@xxxxxxxxxxxxx
  • Date: Wed, 04 Aug 2010 08:36:57 +0100

How about something like this...

1) Attempt open to the source file using FILE_SHARE_READ.
2) If this fails, try to open with FILE_SHARE_READ | FILE_SHARE_WRITE
3) If this succeeds, create a snapshot copy of the file and compress 
that instead of copying the original.

4) To create the snapshot...
a) create a checksum during the copy process
b) when the copy process is complete, verify the length and the checksum 
to see if the file has changed.
c) if it has changed, pause for one second and repeat the process to 
ensure a valid snapshot is used.
d) if three attempts to take a snapshot fail then call 
SetLastError(ERROR_SHARING_VIOLATION) and quit.

Hope this helps

-- James Turner



R Peters wrote:
> If you know that certain files will be open you can exclude them but I think
> I can modify it so that it will skip files that are locked but you will need
> to specify a switch to force it ('*.* /p+').
> I don't like the logic of forcing it to do what I consider should be normal
> - FILE_SHARE_READ - but to do otherwise would break code.
> It will take a few days, in part because first I must work out why it is
> causing a fatal error when it should have only been a warning.
> Also I need to fix your other problem too.
> Russell Peters
>
> On Wed, Aug 4, 2010 at 3:00 PM, Allan Fernandes <allan_fernandes@xxxxxxxxxxx
>   
>> wrote:
>>     
>
>   
>> Hi Russell,
>>
>>     
>>>>   1. What version of Windows?
>>>>         
>> 1) I am using Windows XP.
>>
>>     
>>>>   2. What error does it finish with (preferably the DllError).
>>>>         
>> 2) Without password DllErrCode = 606077985 , with password DllErrCode =
>> 605443072
>>
>>     
>>>>   3. Does it happen each time.
>>>>         
>> 3) It happens each time
>>
>>     
>>>>   4. Are you encrypting to the file.
>>>>         
>> 4) Happens irrespective of giving password to the Zip.
>>
>>
>> Below I have added the OnMessage events details.
>> FSpecArgs = C:\Delit\Chk\*.*
>> I have deliberately taken only one file (open) to reduce the size of trace
>> messages.
>>
>> Observation:
>> This happens only to files that give following message while copying via
>> windows explorer (ex: Outlook.pst, Absolute database )
>> 'Cannot copy SSIIPL.dat : The process cannot access the file because
>> another process has locked a portion of the file.'
>>
>>
>>     
>>>> It is never a good idea to zip an in-use file, also not a good idea to
>>>>         
>> rely on file access settings to prevent zipping.
>> I just need the open file to be skipped.
>>
>> Thank You
>> Allan Fernandes
>>
>>
>>
>> ErrCode 0 Message Trace: done = 0
>> ErrCode 0 Message Trace: Opening c:\delit\zm.zip
>> ErrCode 0 Message Open = Input file does not exist
>> ErrCode 0 Message Trace: done = 0
>> ErrCode 0 Message Loaded C:\WINDOWS\system32\DelZip190.dll
>> ErrCode 0 Message trace is on, ZipExec [1 1 0]
>> ErrCode 0 Message Trace: setting compression level to 3
>> ErrCode 0 Message Info: Using DelZip190.dll version 1.9.0.0079, Apr 20 2010
>> ErrCode 0 Message Trace: root = C:\Delit\
>> ErrCode 0 Message Info: Time Hour 4, min 41, sec 16 msec 562
>> ErrCode 0 Message Info: g+ j+ J- m- o- S- t-
>> ErrCode 0 Message Trace: IsFileSyatemOldFAT called for C:\Delit\
>> ErrCode 0 Message Info: Max component size for C:\ = 255
>> ErrCode 0 Message Info: Do not compress:
>> ".gif:.png:.z:.zip:.zoo:.arc:.lzh:.arj:.taz:.tgz:.lha:.rar:.ace:.cab:.gz:.gzip:.jar:.jpg:.jpeg:.7zp:.mp3:.wmv:.wma:.dvr-ms:.avi:"
>> ErrCode 0 Message Info: Exclude: ""
>> ErrCode 0 Message Trace: ready to read zip file
>> ErrCode 0 Message Info: ready to open: c:\delit\zm.zip for read only
>> ErrCode 0 Message Info: Exclude now: ""
>> ErrCode 0 Message Trace: IsFileSyatemOldFAT called for C:\Delit\Chk\*.*
>> ErrCode 0 Message Info: Collecting C:\Delit\Chk\*.* recurse
>> ErrCode 0 Message Trace: in Wild of win32zip.c, pattern=C:\Delit\Chk\*.*
>> recurse=1
>> ErrCode 0 Message Trace: in procname, name=C:\Delit\Chk\SSIIPL.dat
>> recurse=0
>> ErrCode 0 Message Info: Adding file C:\Delit\Chk\SSIIPL.dat to found list
>> ErrCode 0 Message Trace: processing lists
>> ErrCode 0 Message Info: action = ADD
>> ErrCode 0 Message Info: zcount=0 (no. of files in ZIP already)
>> ErrCode 0 Message Info: Destination type = 3
>> ErrCode 0 Message Trace: checking marked entries
>> ErrCode 0 Message Trace: checking new entries
>> ErrCode 0 Message Info: found list has at least one entry - a
>> ErrCode 0 Message Trace: Processing - ready to create new file
>> ErrCode 0 Message Info: Zipping up 1 NEW entries from found list
>> ErrCode 0 Message   adding: Delit\Chk\SSIIPL.dat
>> ErrCode 0 Message Trace: zipup: Delit\Chk\SSIIPL.dat
>> ErrCode 0 Message  file size changed while zipping: C:\Delit\Chk\SSIIPL.dat
>> ErrCode 0 Message Trace:  i=0, fsize=1507708
>> ErrCode 0 Message Trace: writing Local Header: Delit\Chk\SSIIPL.dat
>> ErrCode 11681 Message C:\Delit\Chk\SSIIPL.dat
>> ErrCode 11669 Message  File error while zipping: C:\Delit\Chk\SSIIPL.dat
>> ErrCode 0 Message Trace: *** BACK FROM CALL TO ZipProcess ***
>> ErrCode 0 Message Files acted on = 0
>> ErrCode 0 Message Trace: RetVal = 0
>> ErrCode 0 Message Info: deleting damaged c:\delit\zm.zip
>> ErrCode 0 Message Info: destroying 'c:\delit\zm.zip'
>> ErrCode 0 Message Unloaded C:\WINDOWS\system32\DelZip190.dll
>> ErrCode 0 Message Trace: done = 0
>>
>>
>>
>>
>> -----------
>> To unsubscribe from this list, send an empty e-mail
>> message to:
>>  delphizip-request@xxxxxxxxxxxxx
>> and put the word unsubscribe in the subject.
>>
>>     
>
>
> -----------
> To unsubscribe from this list, send an empty e-mail 
> message to:
>   delphizip-request@xxxxxxxxxxxxx 
> and put the word unsubscribe in the subject.
>
>   
-----------
To unsubscribe from this list, send an empty e-mail 
message to:
  delphizip-request@xxxxxxxxxxxxx 
and put the word unsubscribe in the subject.

Other related posts: