Permission denied caused by NSURL resource leak?

The My Mac application copies files that the user delays. The application is isolated. I now have an error that I can reliably reproduce in Xcode, but I cannot track the source.

When I add a certain number of files, the application suddenly ceases to be available to later ones. All source files go down one level from the same parent directory, and all folders between them have the same permissions, checked with ls -l. The application saves the application’s bookmark Destination Directory, which is accessed before creating .directoryNameand starting to copy the file.

I get an error message:

Domain error = NSCocoaErrorDomain Code = 513 "Filename.ext" could not be copied because you do not have permission to access ".directoryName". "UserInfo = 0x6080000eaf80 {NSSourceFilePathErrorKey = / Users / Username / Parent directory /Subdir/Filename.ext, NSUserStringVariant = (copy), NSDestinationFilePath = / Users / Username / Desktop / Destination Directory / .directoryName / Filenameathext, NSFile Users / Username / Parent Directory /Subdir/Filename.ext, NSUnderlyingError = 0x6080004567a0 "The operation could not be completed. "}

During debugging, I did the following:

  • I tried adding it Subdir/Filename.extmyself after exiting and restarting, which worked
  • ( lsof Activity Monitor), ( , )
  • , -[NSURL startAccessingSecurityScopedResource] to -[NSURL stopAccessingSecurityScopedResource] ( CF)
  • , Filename.ext , ,
  • ,
  • root, . EXC_BAD_INSTRUCTION, sudo (, )

, -, - , , . , ?

, , . , , :

ItemIdentifier (1) !

, - : Sandboxed Mac, URL ,

, () " ". , Cocoa ( ). () , - .

, , , , , . , , , , , , NSFilenamesPboardType . NSURL , .

2

DTS-, , . (, , ?), .

Apple DTS

-, , . : rdar://20652066, .

+4
1

El Capitan (10.11) (, , ). SDK, .

0

All Articles