Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

helloking

macrumors newbie
Original poster
Nov 16, 2009
1
0
Hi Guys
I am trying to copy a folder from removable storage device to the local machine and i am using the function from NSFileManager class "copyItemAtPath: toPath:". It fails and the error description i get is as follows:

Error Domain=NSPOSIXErrorDomain Code=1 UserInfo=0x12f49d90 "Operation could not be completed. Operation not permitted"

I am able to copy files from removable storage device to the local machine using this method and i am also able to copy files and folders from local machine to removable storage usng the same method.

It would be great if any of you guys can decipher the error and let me know the details of how to get around the error in this particular case.

Thanks
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Have you only tried it on the same device or a second device? Maybe something's wrong with that device. Does Finder let you do what you want to do? (just trying to rule out any weird OS issues. Really doubt there's a bug in the API but you never know.)
 

chown33

Moderator
Staff member
Aug 9, 2009
10,706
8,346
A sea of green
What is the removable storage device, exactly?

What format is it in (HFS, FAT, other)?

Are there any device-nodes, fifos, etc. on the storage device?

What is the ownership and permissions on the device's items?

Have you considered applying a search to narrow down exactly which file or item isn't being copied? For example, a simple recursive descent should narrow it down quickly.

1. Scan the contents of the folder.
2. For each folder, try copyItemAtPath: toPath to a test location.
3. If it works, go to next item.
4. If it fails, recursively apply 1-4 to the failing folder.
5. If all sub-folders copy correctly, the problem lies with one of the non-folders in the directory (i.e. one of the items that wasn't copied in 2.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.