How to see which files are open on shares

Im fairly new to OS X Server. Am running OS X Server 10.6.8


How can i see files that are open through AFP or SMB? I've tried the command lsof but that doesnt seem to show open files through network.

Posted on Aug 10, 2011 2:19 AM

Reply
2 replies

Aug 10, 2011 3:03 PM in response to applealiasse

Try smbstatus.


To pin down exactly which files are locked for use, try:

smbstatus | grep -i deny_write


For AFP, I'm not sure exactly how it's done -- there isn't an afpstatus command, so I'm a bit in the dark. However, you could probably use a combination of lsof and grep to find any objects of type REG and owned by applefile.


Maybe this:


sudo lsof | grep -i "^applefile" | grep REG


But that will return everything in use by the AppleFile service. From there, though, one may need to be familiar with what shares are on the system to further deduce what's open. For example, I get 10 lines returned, but only one of them contains a known share name (/Users/username/path/to/file), the rest are system directories (/System, /private, /usr, /Library and the like).


Hope this helps a bit.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to see which files are open on shares

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.