Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ithil

macrumors newbie
Original poster
Jul 2, 2006
5
0
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.

Thanks.
 

mrichmon

macrumors 6502a
Jun 17, 2003
873
3
slooksterPSV said:
Under OS X, if you log into a server for your home directory, then you cross over into the network via /private/server_name/users_folder ...
so you could enumerate the path to the Home Directory and test to see if /private is one of those paths, if it is, then you know that the user's home directory is on a network volume. Also your other connected volumjes digg deep into private. You'll have to view it yourself and figure it out.

/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.
 

slooksterPSV

macrumors 68040
Apr 17, 2004
3,544
306
Nowheresville
mrichmon said:
/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.
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.