Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: finding local shares



On Aug 4, 2005, at 3:11 PM, Philip D. Wasson wrote:
I'm trying to figure out how to generate a list of local shares (exports, whatever). More precisely, given the share name someone would see from a different machine, and knowing the share is from the machine I'm running on, how do I find the path to that directory?

I thought I had it figured out, using a combination of property lists and NetInfo (./config/SharePoints, ./users/<username>/ sharedDir), but now I find that in 10.3 and later I can't use NetInfo. Is that information now accessed via Open Directory? I don't suppose anyone has done something like this already and could point me at some sample code? (I guess anything that reads something that is in NetInfo the new way would be extremely helpful.)

TIA

Philip,

There are two options... the most expedient one would be to grab the headers for the NetInfo APIs from the appropriate Darwin project and just continue using them. This can be done by grabbing the appropriate version of the Libinfo code from http:// darwinsource.opendarwin.org or http://www.opensource.apple.com/ darwinsource/.

Then as root, run "make installhdrs" inside Libinfo-221. This installs the netinfo headers into /usr/local/include/netinfo.
% sudo -s
% cd Libinfo-221
% make installhdrs


The replacement API for this is called Directory Services (also known as Open Directory). In order to access sharepoints there is a standard type for this as of 10.4 (kDSStdRecordTypeSharePoints). There is not currently a standard type for sharedDir, so you'd need to use the native type of dsAttrTypeNative:sharedDir for that. Pre-10.4 you could use dsRecTypeNative:config/SharePoints for the record type.

The API documentation for Directory Services is here:

http://developer.apple.com/documentation/Networking/Conceptual/ Open_Directory/

-Jason
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >finding local shares (From: "Philip D. Wasson" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.