MAE: asdtool For AppleSingle & AppleDouble Conversion (9/95)

I would like to edit a file that was saved in MAE with a UNIX application, however, I am unable to work with the file. I understand that MAE uses AppleSingle format to save files to the UNIX file system. How can I work with these files (like PICT, JPEG, and text) in UNIX without always starting up MAE with the -filedouble option?
UNIX programs, like vi, do not expect the Macintosh file header, or resource fork, used in the AppleSingle file format. Converting an AppleSingle file to an AppleDouble format file will let UNIX programs read it by separating the resource fork from the data fork.

Apple provides a utility called asdtool to convert AppleSingle format files to AppleDouble format files and vise versa, with the option of translating a carriage return to a linefeed, and handling wide chars like Kanji. This utility is available on:

ftp.support.apple.com:/pub/mae/utilities/asdtool.tar

Follow the steps below to use the asdtool utility:

Step 1
------
Perform the following command to un-tar the utility:

tar xovf asdtool.tar

Place the appropriate file (asdtool.hp or asdtool.sun) in the /apple/bin directory. (You can place this file anyplace, but /apple/bin/asdtool would be a logical place. Also, you can rename the file to asdtool from asdtool.hp or asdtool.sun.)

Step 2
------
If you desire, add the man page for asdtool (asdtool.1).

* Solaris:
cp ./asdtool.1 /usr/share/man/man1/asdtool.1
catman 1

* HP (Hewlett Packard)
cp ./asdtool.1 /usr/man/man1/asdtool.1
catman 1

Step 3
------
To convert an AppleSingle format file to an AppleDouble format file, issue the following command:

asdtool 'filename'

From within UNIX, you will find that there are now two files associated with the original, for example, filename_dbl and %filename_dbl.

NOTE: The original AppleSingle format file will be left unchanged.

Step 4
------
From a UNIX program, like vi, you can now edit the filename_dbl. (The %filename_dbl file is the resource fork.)

Step 5
------
To convert an AppleDouble format file to an AppleSingle format file, issue the same command (asdtool 'filename' -- as shown in Step 3). The new file created will be named, filename_sgl.

NOTE: The filename to use for Step 5, should NOT be the AppleDouble file that begins with '%' (percent), because asdtool will improperly create the AppleSingle file from that file.

Step 6
------
The asdtool can deduce the source file format and convert to the other file format, placing the suffix _sgl or _dbl to distinguish the type.

Step 7
------
The two options are as follows for asdtool:

-t Specifies translation of carriage returns to linefeeds.

-w Specifies source files use wide characters such as Kanji.


Support Information Services
Published Date: Feb 19, 2012