tags:

views:

477

answers:

2

Hi

I am trying to copy files from my mac to a network drive. When copying the files, an empty file is created at the destination and I get a prompt saying I might have to enter an administrator password to change the file named "whatever my file name is". When I press continue, the password dialog shows it is com.apple.desktopservices which is asking for the password.

From what I see happening, an empty file is first created and then I am prompted for a password. Once I enter the password, the empty file is removed and another file is created. It is to this file that the contents are written.

Any ideas why this should happen?

Thanks.

P.S. The file has full read-write permissions

A: 

How are you copying the files? Are you using NSFileManager, or an AppleScript that talks to the Finder, or what?

Peter Hosey
Peter, I am using NSFileManager but mainly BSD functions like read,write,creat etc.
lostInTransit
NSFileManager has methods to do the copy. Look at http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/Reference/Reference.html#//apple_ref/occ/instm/NSFileManager/copyItemAtPath:toPath:error:. That requires Leopard, but there's also a pre-Leopard method.
Peter Hosey
I am mainly using BSD functions to create, read from and write to files. I am using this program to write across file systems.
lostInTransit
It should work just fine across volumes. And you already said you're mainly using BSD functions—you don't need to repeat yourself. That said, if you *insist* on not using Cocoa for some reason, try the copyfile function.
Peter Hosey
A: 

Is the file actually created, or is Finder just displaying an icon for it? What kind of machine is the network drive (another Mac, a Windows machine, a NAS?), and what protocol are you using to connect to it? (SMB, CIFS)?

Mo