Is it possible to mount a subdirectory of a server volume using
FSMountServerVolumeSync? As an example, I've got an NSURL that is
basically cifs://example.com/PERSONAL/doej where PERSONAL is the
actual volume, but I want to mount doej as if it were the volume. In
the code below, I'm getting 'PERSONAL' on the Desktop instead of the
desired 'doej'.

mount_afp yields the desired results and shows 'doej' on the Desktop
instead of 'PERSONAL'.

The code I'd love some guidance on is:


#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
  @autoreleasepool {
    NSURL *url = [NSURL URLWithString:@"cifs://example.com/PERSONAL/doej"];
    OSStatus err = FSMountServerVolumeSync(

(__bridge CFURLRef) url,
                                                                       NULL,
                                                                       NULL,
                                                                       NULL,
                                                                       NULL,
                                                                       0);
      if (err != noErr)
      {
        NSLog(@"Unable to mount %@", urlString);
      }
      else {
        CFShow((__bridge CFStringRef)mountPoint);
      }
    }
  return 0;
}


--
Joe Wollard
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to