• 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
Mount Disk Images Volumes with password
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mount Disk Images Volumes with password


  • Subject: Mount Disk Images Volumes with password
  • From: Lorenzo <email@hidden>
  • Date: Tue, 06 Apr 2004 11:23:53 +0200

Hi,
I use the unix command "hdiutil info -plist" to get information about a
mounted disk image in order to mount it later again. I get a pList
(NSDictionary) with some keys.
I iterate through the key @"images" then through the key @"system-entities"
and when I find the key @"mount-point" equal to my disk mount point, this
means that the @"images" item value is the one I need. It works well.

I would like to know:
Does the value at the key @"image-alias" contain a NSData alias useful to
mount the volume with the following routine?

- (BOOL)MountVolumeFromAliasData:(NSData*)aliasData
{
AliasHandle outAlias = nil;
FSRef target;
OSErr err;

outAlias = (AliasHandle)NewHandleClear([aliasData length]);
[aliasData getBytes:*outAlias];

err = FSResolveAlias(NULL, outAlias, &target, &wasChanged);
DisposeHandle((Handle)outAlias);

return (err == noErr);
}


Also, using the routine above with a traditional AliasHandle (I get with the
Carbon API "FSNewAlias") I can mount only disk image volumes without
password. Instead I suppose that using the unix command "hdiutil mount" I
could be able to mount a disk image volume with a password.
Which sintax should I use in order to mount the volume with a password?
Sorry, but I found the "man hdiutil" in the Terminal to hard for my
comprehension. Too much teory and few sample-code.


Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Re: Interface Builder Is Driving Me Nuts
  • Next by Date: Scrolling Back Terminal Window
  • Previous by thread: Dragging from dock to application
  • Next by thread: Scrolling Back Terminal Window
  • Index(es):
    • Date
    • Thread