login about faq

In my cocoa application, i am trying to compress my .ps file using chilkat library. But some time (Rare case - lets say 5%) below issue occurs

> errno: 13 osErrorMessage: Permission
> denied Failed to open file. mode: r
> path:
> /private/var/spool/WQueue/Lilla/1427257004.ps
> --fopen_failed Failed to open file data source.
> ChilkatLog: CompressFile: DllDate: Jul
> 21 2014 ChilkatVersion:
> UnlockPrefix: WNOZIP Architecture:
> Little Endian; 64-bit Language: Cocoa
> Objective-C VerboseLogging: 1 inPath:
> /private/var/spool/WQueue/Lilla/1427257004.ps
> outPath:
> /Users/Lilla/Library/Application
> Support/W/hub_1427257004.prn.zip
> fopen_failed: errno: 13
> osErrorMessage: Permission denied
> Failed to open file. mode: r path:
> /private/var/spool/WQueue/Lilla/1427257004.ps
> --fopen_failed Failed to open file data source. --CompressFile
> --ChilkatLog

At what time this type of issue occurs...? Chilkat, please provide the solution to accomplish this issue.

asked Apr 01 '15 at 07:33

hubTeam's gravatar image


edited Apr 14 '15 at 09:54

jpbro's gravatar image

jpbro ♦

It's an OS error, meaning that the file is likely locked by another process or thread when you are trying to access it. You could test for this failure and retry after a short delay (perhaps a few times). If the failure continues for a certain period then you could alter the user.

Also, it might help to post the entire contents of the LastErrorText property rather than just a snippet.


answered Apr 01 '15 at 09:21

jpbro's gravatar image

jpbro ♦

Added additional information/log that i got from our analytical report.

(Apr 14 '15 at 01:10) hubTeam

As mentioned, it appears to be an error generated by the operating system indicating that the file is locked by another process or thread. There's not much you can do about that on the first pass.

In the off-chance that it is a Chilkat bug, I'd try your code again with the latest verions ( instead of that you are using), but it's just a fact of life that files can be locked sometimes, so you should code some kind of retry/delay/retry/delay loop, and then fail if it takes too long to perform the desired action rather than just fail on the first failure.

(Apr 14 '15 at 09:59) jpbro ♦

The LastErrorText shows that Chilkat (internally) called the fopen function (http://www.cplusplus.com/reference/cstdio/fopen/ ) and the exact args passed were "r" for the access mode, and "/private/var/spool/WQueue/Lilla/1427257004.ps" for the path. The fopen system call returned NULL indicating failure, and the errno was set to 13, indicating "Permission denied". The "Permission denied" string is obtained by calling strerror(errno) (http://man7.org/linux/man-pages/man3/strerror.3.html )


answered Apr 14 '15 at 12:53

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

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



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



Asked: Apr 01 '15 at 07:33

Seen: 2,484 times

Last updated: Apr 14 '15 at 12:53

powered by OSQA