Login  •  Register

The time is now: Fri Nov 15, 2019 12:59 pm

Emaculation wiki  •  Delete all board cookies

Post new topic  Reply to topic Page 1 of 1 [ 3 posts ]
Print view Previous topic  |  Next topic
Author Message
PostPosted: Sun May 06, 2018 8:39 pm 
Apple Corer
User avatar

Joined: Fri Aug 27, 2010 1:02 am
Posts: 227
There are ways to convert between various archive and image formats on macOS using the Terminal.

"The Unarchiver" supports Stuffit (.sit), Stuffit X (.sitx), MacBinary, BinHex, along with many other archive formats, and it has a command line tool: https://theunarchiver.com/command-line

To use it:
unar file.sit

It also extracts resource forks and Finder Info, so you don't lose any information.
You can use the following command to check resource fork and Finder Info information:
ls -@l /path/to/file/or/folder

Check for the presence of "com.apple.FinderInfo" and "com.apple.ResourceFork" attributes.

You can create .tar.gz files with extra attributes (including resource forks and Finder Info) using this command:
tar -czf /path/to/archive.tar.gz /path/to/file/or/folder

You can convert into MacBinary II using macbinary tool:
macbinary -t 2 encode -o /path/to/macbinary.bin /path/to/file

You can convert NDIF, DiskCopy 4.2, Toast disk images, macOS DMG images, etc:
hdiutil convert -format UDxx -o /path/to/output/image.img /path/to/input/image.dmg
The format UDxx will work with emulators, but there are many other formats you can convert to.
hdiutil convert -help
for a listing of the formats you can convert to.
This tool won't work with DiskSet formats such as the ones used in the Mac OS 7.5.3 install sets (.smi/.part). You need to use Disk Copy 6.3.3 in an emulator to mount the image, then create an image from the mounted image.

You can "bless" a System Folder using the bless command line tool:
sudo bless -folder9 /path/to/System/Folder

You can also set a label that will appear in the menu when you hold down option while booting:
sudo bless -folder9 /path/to/System/Folder -label "Your Label"

You can run these commands in batch if you combine it with the find command. For example:
find . -name \*.sit -exec unar {} \;
will extract all Stuffit archives in the current directory.
find . -name \*.img -exec hdiutil convert -format UDxx -o {}.dmg {} \;
will convert all disk image files ending in .img to a format usable in emulators.

Reply with quote Post a reply  
PostPosted: Mon May 07, 2018 4:38 am 
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2719
Location: Emaculation.com
I've been considering writing a wrapper app that just lets you select these options from a menu or button panel. Would anyone be interested in that?

I'd also add in my "sparserbundler" script that converts images to .sparsebundle images with 1MB file segments. These are great for using with emulators and Time Machine, as only the partitions that have changed get backed up. To compact the image when it starts to get large, you just run it through the sparserbundler droplet again and it drops all the unused segments.

hdiutil convert "$1" -format UDSB -tgtimagekey sparse-band-size=2048 -o "$1-1Mb.sparsebundle"

Reply with quote Post a reply  
PostPosted: Mon May 07, 2018 3:32 pm 
User avatar

Joined: Fri Oct 13, 2017 4:34 pm
Posts: 82
Location: Mexico
It would be great, as it's simpler than using a commandline

Hill radio station first attempt: Failure. Retrying...

Reply with quote Post a reply  
Display posts from previous:  Sort by  
Post new topic  Reply to topic Page 1 of 1 [ 3 posts ]

Who is online

Users browsing this forum: No registered users and 13 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group