Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 6, 2006, 01:47 AM   #1
ithil
macrumors newbie
 
Join Date: Jul 2006
Detecting network path

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.
ithil is offline   0 Reply With Quote
Old Jul 7, 2006, 04:59 PM   #2
slooksterPSV
macrumors 68030
 
Join Date: Apr 2004
Location: Nowheresville
Send a message via AIM to slooksterPSV Send a message via MSN to slooksterPSV Send a message via Yahoo to slooksterPSV
COMMENT REMOVED - mrichmon gave the perfect way to do it.
__________________
AMD Phenom 9600, 2GB RAM, 250GB HDD, ATI Radeon 4850, Vista Home Premium 64-bit
Gateway NV53 with Windows 7 Home Premium 64-bit & Ubuntu 10.04 Lucid Lynx 64-bit

Last edited by slooksterPSV; Jul 8, 2006 at 01:21 AM.
slooksterPSV is offline   0 Reply With Quote
Old Jul 8, 2006, 01:13 AM   #3
mrichmon
macrumors 6502a
 
Join Date: Jun 2003
Quote:
Originally Posted by slooksterPSV
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.
mrichmon is offline   0 Reply With Quote
Old Jul 8, 2006, 01:20 AM   #4
slooksterPSV
macrumors 68030
 
Join Date: Apr 2004
Location: Nowheresville
Send a message via AIM to slooksterPSV Send a message via MSN to slooksterPSV Send a message via Yahoo to slooksterPSV
Quote:
Originally Posted by mrichmon
/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.
__________________
AMD Phenom 9600, 2GB RAM, 250GB HDD, ATI Radeon 4850, Vista Home Premium 64-bit
Gateway NV53 with Windows 7 Home Premium 64-bit & Ubuntu 10.04 Lucid Lynx 64-bit
slooksterPSV is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Spying / detecting intrusion. noodile Mac Basics and Help 6 Mar 8, 2014 04:35 AM
Detecting Network Traffic Within An Application ahan.tm iPhone/iPad Programming 0 Feb 16, 2014 07:48 PM
Social Network Path Updating iOS App with Private Sharing, 'Inner Circle', Premium Membership MacRumors iOS Blog Discussion 6 Sep 6, 2013 05:13 PM
MacBook air not detecting the WiFi network which my iPhone does! wrongsock Mac Basics and Help 0 Apr 14, 2013 03:02 AM
Network detecting a Time Capsule that doesn't exist? GMunroe Mac Peripherals 0 Jun 12, 2012 12:39 PM

Forum Jump

All times are GMT -5. The time now is 07:55 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC