views:

51

answers:

1

I have a daemon that is running as user nobody.
It needs to copy a file that I specify into /Users/Shared/MyFolder
If I tell it to copy a file that is already in /Users/Shared/ it works fine.
If I tell it to copy it from somewhere in my home directory like the desktop, the copy fails.
I'm using NSFileManager copyPath:toPath:

Any ideas?

+3  A: 

Not going to happen from a process running as "nobody" without special authorization. I'm assuming you have some sort of UI that prompts for the file, right? If so, consider using Authorization Services to authorize the copy when needed.

Also, in case you're hoping for your daemon to work with files in a user's home folder without that user being logged in, consider the existence of FileVault-protected home folders ... you won't be able to touch the user's home folder contents if the user isn't logged in (and the FileVault volume isn't mounted to /Users/username).

Joshua Nozzi