Dear Cocoa List,

I’m trying to remove an application package using

NSFileManager.defaultManager().removeItemAtPath(self.appPackage, error: &error)

The application package was put at this location using

NSFileManager.defaultManager().copyItemAtURL(pathURL as! NSURL, toURL: 
self.appPackage, error: &error)

However, when I trigger the code that should remove the application package, I 
get an error that I don’t have the right permissions to delete the application 
package.  The application package is in the user’s space and appears to have 
the correct permissions if I use “Get Info” on it in the Finder.

I also tried setting the file’s permissions directly with

NSFileManager.defaultManager().setAttributes([NSFilePosixPermissions: 0o777], 
ofItemAtPath: self.appPackage.path, error: &error)

This does seem to correctly modify the file’s permissions, in particular I can 
see the “Everybody” setting change from “Read Only” to “Read Write”, but the 
application package still can’t be deleted.

I’ve also tried copying the application package directly to the Desktop and 
then deleting it from there. That doesn’t work either.

Can anyone tell me what I’m doing wrong here?

Thank you,
Arved
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to