login about faq

A customer of mine receives this error (yes, I know it is an older CK library):

write ChilkatLog:
  WriteZipAndClose:
    DllDate: Mar  1 2011
    UnlockPrefix: XXX
    Username: SYSTEM
    Architecture: Little Endian; 32-bit
    Language: Visual C++ 6.0
    Using temp directory where target Zip is located.
    tempFile: \larnacaSunlight_File_shareliveArchiveOutboundckz_Z46S.tmp
    Encryption: 0
    PasswordProtected: 0
    CentralDirOffset: 142717
    NumCentralDirRecords: 1957
    EndOfDirectoryOffset: 279707
    closeHandle:
     windowsHandle: 348
    zipFilename: \larnacaSunlight_File_shareliveArchiveOutboundHMEI20121224.zip
    MoveTempToDestZip1:
     WindowsError: The process cannot access the file because it is being used by another process.
     WindowsErrorCode: 0x20
    MoveTempToDestZip2:
     WindowsError: The process cannot access the file because it is being used by another process.
     WindowsErrorCode: 0x20
    from_filename: \larnacaSunlight_File_shareliveArchiveOutboundckz_Z46S.tmp
    to_filename: \larnacaSunlight_File_shareliveArchiveOutboundHMEI20121224.zip
    Failed to move Zip file
    Failed. 

I am 99% sure it is caused by a virus scanner keeping a lock on the temporary zipfile so the rename to zip fails.

Is there a way I can "inject" a pause (for example 5 seconds) before CkZip tries to rename the tmp file, perhaps using CkZipProgress? That would give the scanner time to free the tmp file.

Alternatively, can you implement retry logic in CkZip for those access-denied (actually ERROR_SHARING_VIOLATION) problems? Or can I just call WriteZipAndClose again myself?

PS, I don't think this customer is allowed to exclude directories from the virus-scanner settings.

asked Jan 14 '13 at 06:44

Gert's gravatar image

Gert ♦
629141824

edited Jan 14 '13 at 06:55

When I edit the post single \s are removed and double \\ change to one \

(Jan 14 '13 at 06:57) Gert ♦

I always recommend testing with the latest version to see if a problem still exists. This would be a good idea in this case.

You cannot "inject" a pause, but your app can certainly wait and re-try the WriteZipAndClose method.

link

answered Jan 14 '13 at 08:34

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

I will ask him to try the latest version that uses the current CK library.

your app can certainly wait and re-try the WriteZipAndClose method.

But in that case I imagine the tmp file is recreated by CkZip? Then it won't help because the virus-scanner will again lock the tmp file so it again can not be moved/renamed by CkZip. It would really be nice if you can implement retry logic for those sharing violation cases.

link

answered Jan 15 '13 at 03:22

Gert's gravatar image

Gert ♦
629141824

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×87
×12
×7
×3
×2

Asked: Jan 14 '13 at 06:44

Seen: 1,507 times

Last updated: Jan 15 '13 at 03:22

powered by OSQA