Re: Folder sharing attributes
Re: Folder sharing attributes
- Subject: Re: Folder sharing attributes
- From: Peter Alshuth <email@hidden>
- Date: Mon, 28 Jul 2008 11:30:17 -0400
Thanks for the info.
I tried this code section but it doesn't work. The result of
sharingFlags is always 0. Is there another way with DirServices to
request the sharing attribute about a folder if this in not working
under Leopard?
Peter
FSRef fileRef;
NSString *filePath = @"/Users/Test/MyShare";
Boolean bDir;
if(filePath && FSPathMakeRef((const UInt8*) [filePath UTF8String],
&fileRef, &bDir) == noErr)
{
FSCatalogInfoBitmap whichInfo = kFSCatInfoSharingFlags;
FSCatalogInfo catalogInfo;
OSStatus err = FSGetCatalogInfo(&fileRef, whichInfo, &catalogInfo,
NULL, NULL, NULL );
if(err == noErr)
NSLog(@"Sharing is %@", (catalogInfo.sharingFlags &
kioFlAttribSharePointBit) ? @"ON" : @"OFF");
}
On Jul 25, 2008, at 11:49 AM, Kyle Sluder wrote:
On Fri, Jul 25, 2008 at 11:27 AM, Peter Alshuth <email@hidden>
wrote:
I was wondering how I can retrieve information about a particular
folder if
this folder is shared or not.
Use FSGetCatalogInfo (part of CoreServices). The FSCatalogInfo struct
has a "sharingFlags" field.
http://developer.apple.com/documentation/Carbon/Reference/File_Manager/Reference/reference.html#/
/apple_ref/c/func/FSGetCatalogInfo
--Kyle Sluder
_______________________________________________
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