Importing files extracted with the Unarchiver (unar)

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Post Reply
andrewferguson
Space Cadet
Posts: 3
Joined: Sat Aug 06, 2016 10:59 am

Importing files extracted with the Unarchiver (unar)

Post by andrewferguson »

Hello,

I am trying to import a Mac OS file (a HyperCard stack) from my computer into SheepShaver. A few years ago, the stack was in a Sit file, but I extracted it with the Unarchiver through the unar command in Debian. This produced two files, the stack and the .rsrc resource fork. I kept those files and discarded the sit.

I am now trying to get this HyperCard stack to open in SheepShaver. I have installed Mac OS 9 and HyperCard 2.4, and put both the stack and the resource fork file in the Unix share. However, HyperCard cannot open the stack (does not appear in the list of files in the "Open stack..." dialog.

Is there a way I can open this stack? Do I need to recombine the resource fork back into the file, and if so is there a way to do this, preferably on a Linux machine before the resulting file is loaded into SheepShaver.

Andrew
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Importing files extracted with the Unarchiver (unar)

Post by Ronald P. Regensburg »

A pity that you discarded the sit file. That was the only way to keep the archived file intact on a non-Mac file system. You could have imported the sit file into SheepShaver and extracted it there. On any other than HFS or HFS+ file system, the file will be split in two, the data fork "filename" and the resource fork, usually named ".filename". In this form the file is unusable.

If recombination is possible, it can only be done if the combined file is saved to a HFS or HFS+ file system. OSX has (I think since MacOSX 10.3) a utility "FixupResourceForks" that could do the job. Maybe someone with a Mac running OSX can try to recombine the files for you and add again the type and creator metadata that were also lost when you extracted the file in Debian.

http://www.unix.com/man-page/osx/1/FixupResourceForks/
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Importing files extracted with the Unarchiver (unar)

Post by adespoton »

It seems to me that if he renamed .Resource as .<filename> and stuck it them on a removable FAT drive, something might be recoverable. I can't remember exactly how the layout works, but it should be possible to lay things out like Apple does on non-HFS volumes and get the OS to re-combine them.

Anyone have more details on this format to give him?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Importing files extracted with the Unarchiver (unar)

Post by Ronald P. Regensburg »

Here is some basic information about AppleSingle and AppleDouble formats:
http://www.macdisk.com/asaden.php
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Importing files extracted with the Unarchiver (unar)

Post by adespoton »

Here's some basic info on how named forks are stored on flat file systems:
https://discussions.apple.com/docs/DOC-1876
Jorpho
Master Emulator
Posts: 380
Joined: Fri Sep 17, 2004 4:22 am

Re: Importing files extracted with the Unarchiver (unar)

Post by Jorpho »

andrewferguson wrote:Do I need to recombine the resource fork back into the file
Yes.
and if so is there a way to do this, preferably on a Linux machine before the resulting file is loaded into SheepShaver.
EDIT: All you need is a program to convert AppleDouble into MacBinary, copy the result to your HFV volume, and then decode it again with Stuffit Expander (or any other such utility) within Sheepshaver. And such a utility is readily available in Linux.
http://linuxcommand.org/man_pages/unbin1.html

Unfortunately, the syntax is ambiguous. Try "macbinary whatever whatever.rsrc". If that doesn't work, try renaming "whatever.rsrc" to "._whatever" and then "macbinary whatever".

[Needlessly complex rambling follows.]

This is discussed at http://emaculation.com/doku.php/extract ... in_windows . If you were running in Windows, the procedure would be to rename "whatever.rsrc" to "%whatever", browse to the folder with HFV Explorer, and copy the file to your HFV volume. Since you're running Linux, you could always try an ancient version of Executor instead – though I would doubt the binary is at all easy to get running anymore. Or maybe HFV Explorer runs in Wine.

Another idea that comes to mind is to use the Apple .zip format:
  • Create a folder named __MACOSX in the folder containing "whatever".
  • Move "whatever.rsrc" into __MACOSX and rename it to "._whatever".
  • Create a standard .zip archive that includes both "whatever" and the __MACOSX subfolder.
  • Copy the .zip file to your HFV volume and decompress it inside Sheepshaver using the utility from this thread.


In theory, you might be able to re-arrange the resource fork data on your Unix drive so that it's stored in the way Sheepshaver expects to find resource fork data on a non-HFS drive, i.e. by sticking it in a folder named ".finf". But I never worked out the particulars of that arrangement and I'm not sure it's the standard AppleDouble format.
andrewferguson
Space Cadet
Posts: 3
Joined: Sat Aug 06, 2016 10:59 am

Re: Importing files extracted with the Unarchiver (unar)

Post by andrewferguson »

Jorpho,

Wow! What you describe sound exactly like what I am looking for. However, I can't find a way to get the macbinary program. It is not in the package repositories for debian, nor can I find a website. Is it this GitHub repository https://github.com/johnnywalker/netatalk ? Or can I find a precompiled version elsewhere?

Andrew
Jorpho
Master Emulator
Posts: 380
Joined: Fri Sep 17, 2004 4:22 am

Re: Importing files extracted with the Unarchiver (unar)

Post by Jorpho »

Ah, fiddlesticks, of course it wouldn't be that easy, would it?

It does appear to be part of the netatalk package, but indeed, https://packages.debian.org/jessie/netatalk turns up nothing. Searching for "macbinary" at http://rpm.pbone.net/ turns up a lot of results for netatalk, including packages for CentOS 6. Maybe one of those will work – apparently you need to use "alien", or if all else fails you can just fire up a live CD in VMware or VirtualBox.
andrewferguson
Space Cadet
Posts: 3
Joined: Sat Aug 06, 2016 10:59 am

Re: Importing files extracted with the Unarchiver (unar)

Post by andrewferguson »

I don't suppose that macstream (http://linuxcommand.org/man_pages/macstream1.html) would do the same thing? (It comes with the macutil package in debian). I am not really sure how to use it if it can.
CharlesS
Granny Smith
Posts: 107
Joined: Thu Aug 14, 2008 9:05 am

Re: Importing files extracted with the Unarchiver (unar)

Post by CharlesS »

First thing to do is to determine what format the dotfile is in. It's most likely AppleDouble, but if it's something else (like a straight copy of the resource fork), it's good to know that before wasting time on an AppleDouble copy.

What happens if you run the 'file' command on the dotfile?

Alternatively, you could e-mail the two files to me (support, then the thing that looks like an "a" with a circle around it, then charlessoft, then a period, then com) and I could send them back to you in the form of a disk image that SheepShaver could open, if you like. I'm the author of a popular decompression tool for the Mac, so I've got a lot of experience dealing with these files.
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.
Jorpho
Master Emulator
Posts: 380
Joined: Fri Sep 17, 2004 4:22 am

Re: Importing files extracted with the Unarchiver (unar)

Post by Jorpho »

Unar only supports AppleDouble and cannot create straight copies of the resource fork, so no question there.
Post Reply