rename over network open new handle when done from mac to windows

Hi,
I have a folder present in windows , which i am mounting from mac side using smb. Into this mounted location i'm trying to write a new file over the network. After writing the data into the file , the handle is closed.


Now i need to rename the file over network from mac side .
So for that, making use of stdlib rename(), observed that the file rename is working fine, but renaming of the file is opening a new handle which cannot be captured.

When i try to delete the same file over network using DeleteFile api ,the file gets marked for delete , but actually
fails to delete and the permission of the files gets changed as the the file is still open(which i came
to know from computer management open files).

So stdlib rename api is opening the new handle while
renaming which prevents the file from delete. stuck with this issue and Need inputs to fix it.

Using XCode version 7.3.1
If you do the same thing from Terminal, using mv and rm, do you see the same problem?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Hi Quinn,

Tried with mv from terminal , observed the file handle gets open and the file appearing in open state in windows computer management..
So the answer is “Yes, it does reproduce with mv.”? Given that, this seems like a bug (albeit a serious one) and I encourage you to file it as such.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
rename over network open new handle when done from mac to windows
 
 
Q