Technical Q&A NW09

Testing for a Network Volume

Q:  How can I reliably determine if a volume is mounted over the network?

A: There are numerous ways to test whether a volume is a network volume. The best method to use depends on the layer that you're working at:

One word of warning here: the distinction between network volumes and local volumes is somewhat blurry these days. For example, you can't assume that network volumes are slow, or that local volumes don't have to deal with file locking issues. In general you should test for the existence of specific functionality rather than making assumptions based on the volume type. For example, you can use the NSURLVolumeSupportsAdvisoryFileLockingKey key to determine whether a volume supports advisory locking.



Document Revision History


DateNotes
2011-09-20

Rewritten to describe the latest techniques.

1998-06-01

New document that shows how to determine if a volume is mounted over the network.