• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Accessing a windows share
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing a windows share


  • Subject: Re: Accessing a windows share
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 2 Apr 2008 07:49:14 -0700


On 1 Apr '08, at 10:59 PM, Valentin Dan wrote:

How can I access (from Cocoa, Objective-C code) a path like : \ \192.1.1.1\c$\SomeDir\AnotherOne\SomePicture.jpg ?

Well, you know the IP address of the server, and the path in its filesystem. That's a start. The key question is: what protocol? Again, I think the answer is "SMB". So I think what you need to do is find out how to mount an SMB volume programmatically. Once you've done that you can translate the path to Unix syntax, prepend the system path to the mount point of the volume, and now you have a filesystem path to the resource that you can access with something like +[NSData dataWithContentsOfFile:].


There aren't any Cocoa APIs for mounting filesystems, so you're going to have to investigate lower-level APIs, either CoreServices or BSD/ POSIX. (And this isn't the appropriate mailing list for that.) Look through the online reference documents in Xcode, or if that fails, look at the list of other mailing lists on http://lists.apple.com to find a place to ask.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Accessing a windows share (From: "Valentin Dan" <email@hidden>)

  • Prev by Date: Re: Problem with Grouping the rotated object.
  • Next by Date: Re: NSWindow z-depth
  • Previous by thread: Accessing a windows share
  • Next by thread: ERROR: __CFURLCache::StepSQLStatement
  • Index(es):
    • Date
    • Thread