stdlib rename api opening new handle when trying to write over network to mounted location

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 ( which is now in a windows folder) 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( came to know from computer management open files).

Tried to print the open handles in mac side using pid but newly open file was not listed. tried using process monitor to capture the events but it was not listing any open handle or telling the process holding it. also tried using process explorer and handler.exe

Not entirely sure what you're asking, but if you want to trace filesystem events on macOS, try fs_usage(1)

stdlib rename api opening new handle when trying to write over network to mounted location

For those reading along at home, this seems to be the same as this thread.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
stdlib rename api opening new handle when trying to write over network to mounted location
 
 
Q