Question about FSMountServerVolumeSync

  • 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
previous month june 2012 next month
MTWTFSS
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
Go to today