Detecting network path

Discussion in 'Mac Programming' started by ithil, Jul 5, 2006.

  1. macrumors newbie

    Hi all,

    Is there any way to detect whether a selected path is on local disk or network path? Or is there any equivalent for Windows API 'PathIsUNC' which detects whether the selected path is network path or not.

  2. macrumors 68030


    COMMENT REMOVED - mrichmon gave the perfect way to do it.
  3. macrumors 6502a

    /private has no bearing on whether a directory is on a local filesystem or on a remote filesystem. AFP mounted shares for example have no record under /private unless you specifically change the automounter default mount location.

    The original poster should look at the XCode Reference library, specifically, Cocoa->File Management->Low-Level File Management Programming Topics. This document has a section "Locating Directories on the System" which discusses the NSSearchPathForDirectoriesInDomains class. I believe that this class will allow you to identify local and remote directories using "Local" and "Network" domains as a mask when obtaining the directory objects.
  4. macrumors 68030


    That's good to know - that was the only way I knew how to test for it because I knew everything routed through /private on the macs at my school to connect to the AFP shares.
    Also I just barely read about something like that, the NSSearchPathForDirectoriesInDomains so I had just barely read that section a while after I made that post. Thanx for the info.

Share This Page