• 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: Folder sharing attributes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Folder sharing attributes (From: Peter Alshuth <email@hidden>)
 >Re: Folder sharing attributes (From: "Kyle Sluder" <email@hidden>)

  • Prev by Date: Re: draw string with ellipsis
  • Next by Date: [Newbie] Communication between two Views?
  • Previous by thread: Re: Folder sharing attributes
  • Next by thread: Loading kernal Extension from Cocoa
  • Index(es):
    • Date
    • Thread