# Uncompress .bin and mount .dmg from commandline



## Viro (Oct 1, 2005)

Anyone know how I go about uncompressing a .dmg.bin image and then mounting that image from the commandline in OS X?


----------



## spb (Oct 1, 2005)

I'm not certain about the uncompression, but you can mound dmg with 

hdiutil mount /path/to/file/filename.dmg

This will mount the dmg to /Volumes/filename/

There is a PERL module for working with hexbin files at:

http://search.cpan.org/~eryq/Convert-BinHex-1.119/lib/Convert/BinHex.pm

This might be a place to start if you want to make a nice PERL script to do both the uncompression and mounting.


----------



## barhar (Oct 1, 2005)

Also, with reference to '.dmg' files (and running MacOS X 10.4 - 'Tiger') ...

hdid path_to_.dmg_file <return>


----------



## ElDiabloConCaca (Oct 1, 2005)

StuffIt Deluxe can expand .bin files, and inclues two command-line StuffIt utilities located in /usr/local/bin: stuff and unstuff.


----------



## barhar (Oct 2, 2005)

Thanks ElDiabloConCaca for the 'unstuff' information.

With 'unstuff' (as the result of installing 'StuffIt Deluxe' version 9) in '/usr/local/sbin/' and 'unstuff -F' <return> entered, the formats supported by 'unstuff' were displayed. They are ...

apple, arc, arj, bin, btoa, bz2, cab, compress, cpt, double, freeze, gz, hqx, lha, mime, pack, pf, rar, sco, sit, sit5, sitseg, sitx, tar, uu, yenc, and zip

... Thus, to decompress 'InstallerUpdate1.0.dmg.bin' and then mount the '.dmg' file - if on the current_user's 'Desktop', one would enter ...

/usr/local/bin/unstuff /Users/current_user/Desktop/InstallerUpdate1.0.dmg.bin; hdid /Users/current_user/Desktop/InstallerUpdate1.0.dmg

..., as one example.


----------



## Viro (Oct 3, 2005)

Cool. Thanks guys.


----------

