I did some testing and can confirm that what Jim wrote below only tells me whether a path has an auto-mount trigger, but not whether it's actually reachable at the moment.
So far, to tell if the volume is actually available I must try to read its content. Often I would then get an error returned for off-line vols immediately, and sometimes the call would take a long time before I get the error, which means that it tried to contact the server, waiting, and eventually timing out. What bothers me is that the "automountd" daemon maintains a state of whether the volume is currently accessible or not, and it silently keeps on checking if the server is reachable. I had hoped that this state would be communicated thru the BSD APIs, but that doesn't seem to be the case. Bummer. Thomas On Sat, Feb 21, 2015 at 11:56 PM, Jim Luther <luthe...@apple.com> wrote: > You can tell if the automounted volume has been auto-unmounted by checking > to see if it is a trigger again — at a low-level with getattrlist() by > checking the DIR_MNTSTATUS_TRIGGER bit returned for the > ATTR_DIR_MOUNTSTATUS attribute, or at a high level by checking the value of > the NS/kCFURLIsMountTriggerKey resource property value. Accessing a path > beyond a trigger of opening the trigger directory will cause the automount > to be mounted. > > However, that doesn’t really answer your question because a mounted > network volume’s server might not be accessible, and mounting/remounting an > automount might not find the file server. Other than pinging the server’s > host, there’s not much you can do to tell the server is reachable (and even > if it pings OK, the NFS server might not be responsive). Someone else might > have more/better suggestions. >
_______________________________________________ Do not post admin requests to the list. They will be ignored. Filesystem-dev mailing list (Filesystem-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/filesystem-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com