Re: How to mount an iDisk?

  • On Thursday, September 20, 2001, at 12:02 PM, Steve Gehrman wrote:

    > How do I mount an iDisk using Cocoa?
    >
    > Thanks
    >

    Did you happen to get a reply to this.  I've been wondering the same
    thing,

    Cheers,
    Brant
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • > On Thursday, September 20, 2001, at 12:02 PM, Steve Gehrman wrote:
    >
    >> How do I mount an iDisk using Cocoa?
    >>
    >> Thanks
    >>
    >
    > Did you happen to get a reply to this.  I've been wondering the same
    > thing,
    >
    > Cheers,
    > Brant

    Private AppKit API's, AppleEvents to Finder or unix tools with pipes. I
    never really tried either, but I think they should all work, more or less...

    / david
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • Thanks for the suggestion.

    mount doesn't appear to handle WebDAV, and I couldn't find a man entry
    for mount_webdav.  I have both a client and a server.  Although it's
    likely going to only ever be the client that initiates the update,
    technically it's the server that contains the data.  SInce I'm already
    using DO, the client can fetch the data and upload it to the iDisk.
    However, if I wanted to automate the process, there's a possibility that
    the user will not be logged in, and thus no finder present.

    Is there a UNIX tool that will work in the finders absence?

    I was also under the impression that system() wasn't recommended for
    security reasons.  Although the first thing the server does, when
    launched, is to setuid to a server user, like www for apache, there's a
    chance that the server, if missconfigured, could still be running as
    root.

    On Monday, February 25, 2002, at 01:19 AM, Steve Gehrman wrote:

    >
    > I sent an apple event to the Finder, but I want to rewrite it using the
    > mount command or mount_webdav.  I'm not sure how to do that yet.
    >
    > + (void)mountiDisk:(NSString*)userName password:(NSString*)password
    > {
    > [self mountAppleShareVolume:userName password:password
    > address:@"idisk.mac.com" volumeName:userName];
    > }
    >
    > + (void)mountAppleShareVolume:(NSString*)userName
    > password:(NSString*)password address:(NSString*)address
    > volumeName:(NSString*)volumeName;
    > {
    > NSString* command;
    > ThreadedSystemCommand* thread;
    >
    > command = [NSString stringWithFormat:@"echo 'Tell Application
    > \"Finder\" \r mount volume \"afp://%@:%@@%@/%@\"\rend tell' |
    > /usr/bin/osascript", userName, password, address, volumeName];
    >
    > system([command cString]);
    > }
    >
    >
    > On Monday, February 25, 2002, at 12:35  AM, Brant Vasilieff wrote:
    >
    >> Did you happen to get a reply to this.  I've been wondering the same
    >> thing,
    >>
    >> Cheers,
    >> Brant
    >>
    >>
    > --
    > Steve Gehrman
    > CocoaTech
    > <sgehrman...>
    > http://www.cocoatech.com
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On Monday, February 25, 2002, at 05:53 AM, David Remahl wrote:
    > Private AppKit API's, AppleEvents to Finder or unix tools with pipes. I
    > never really tried either, but I think they should all work, more or
    > less...

    What is the unix tool?  mount doesn't appear to handle WebDAV.

    Cheers,
    Brant
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On Monday, February 25, 2002, at 07:03 PM, Brant Vasilieff wrote:

    > Thanks for the suggestion.
    >
    > mount doesn't appear to handle WebDAV, and I couldn't find a man entry
    > for mount_webdav.  I have both a client and a server.  Although it's
    > likely going to only ever be the client that initiates the update,
    > technically it's the server that contains the data.  SInce I'm already
    > using DO, the client can fetch the data and upload it to the iDisk.
    > However, if I wanted to automate the process, there's a possibility
    > that the user will not be logged in, and thus no finder present.
    >
    > Is there a UNIX tool that will work in the finders absence?

    In MarshmallowMode I use the following:
    - (void)goToIDisk:(id)sender
    {
        NSString* name=[[NSUserDefaults standardUserDefaults]
    objectForKey:@"iToolsMember"];

        if (![[NSFileManager defaultManager] fileExistsAtPath:[NSString
    stringWithFormat:@"/Volumes/%@",name]])
        {
    [self mount:[NSString stringWithFormat:@"idisk.mac.com/%@",name]
    atPath:[NSString stringWithFormat:@"/Volumes/%@",name]];
        }

        [self setPath:[[NSString stringWithFormat:@"/Volumes/%@",name]
    fileForPath]];
    }

    - (void)mount:(NSString*)uri atPath:(NSString*)path
    {
        [[NSFileManager defaultManager] createDirectoryAtPath:path
    attributes:nil];

        //NSLog(@"Wait for mount.");
        [[NSTask launchedTaskWithLaunchPath:@"/sbin/mount_webdav"
    arguments:[NSArray arrayWithObjects:uri,path,nil]] waitUntilExit];
    }

    Regards,
    John Hornkvist
    --
    ToastedMarshmallow, the perfect Cocoa companion
    http://www.toastedmarshmallow.com
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On Monday, February 25, 2002, at 06:05 PM, Brant Vasilieff wrote:

    > On Monday, February 25, 2002, at 05:53 AM, David Remahl wrote:
    >> Private AppKit API's, AppleEvents to Finder or unix tools with pipes. I
    >> never really tried either, but I think they should all work, more or
    >> less...
    >
    > What is the unix tool?  mount doesn't appear to handle WebDAV.

    mount_webdav does, though. :-)
    Not to mention that you can also access iDisk via AppleShare or AFP or
    whatever it's called.

      -- Finlay
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • There is no man page for mount_webdav, so I'm confused about its use.

    Your example, doesn't seem to account for a user name and password.
    Also, how are conflicts between an iDisk name and other volume name
    resolved?

    Depending on the order of a mount, in the finder, my iDisk comes up as
    either brantv or brantv-1.
    Just something to keep in mind.  It looks like you need to check for
    more than the existence if "/Volmes/MyIDisk", but rather iterate through
    all variants of "/Volume/MyDisk-*" as well.

    I'm most curious about the password though.  I don't see where they're
    being used, unless the mount_webdav brings up the dialog.  If that's the
    case, it wont work for me in a non-UI process.

    Thanks,
    Brant
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • The mount_webdav seems to leave a sticky residue making repeated testing
    difficult.  When I mount an iDisk the first time, it works perfectly.
    However, when I unmount (Eject) the volume in the Finder, the directory
    I linked it to remains in the /Volumes directory.

    I added a check to see if the iDisk was already mounted.  In that, I
    look for a volume that starts with the iDisk name and is a WebDAV
    volume.  On the second attempt, the local directory still remains,  so I
    don't mount the iDisk.

    Should the local folder still exist?  When I eject a Finder mounted
    iDisk, the local bound directory is removed.  Any ideas?

    Another absence in the mount_webdav tool is the ability to mount the
    public folder of someone's iDisk.

    Cheers,
    Brant
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
previous month february 2002 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      
Go to today