HFS(1)

NAME
hfs - program for accessing Macintosh HFS floppy disks

SYNOPSIS
hfs ls [ -laR ] filespec
hfs dir filespec
hfs cd directory
hfs pwd
hfs read [ -tMR ] hfsspec ... native_file
hfs cat [ -txR ] filename
hfs part [ -a ]

DESCRIPTION
hfs provides a command line interface to suite of functions for accessing Macintosh HFS floppy disks, hard drives and CD-ROMS. The following functions are available:

- display a directory listing (ls, dir)

- change directories (cd)

- display the name of the current directory (pwd)

- copy an HFS file into a local file (read)

- display the contents of an HFS file (cat)

- display the partition table on a Macintosh volume.

Functions may be invoked by specifiying the function name
    on the command line followed by any parameters. Alternatively, the executable can be copied or linked to an alternate name which can then be used to invoke the function directly. The alternate names recognised by hfs are hls, hdir, hcd, hpwd, hpart, hread and hcat. The current directory and volume name as detected by hfs are stored in a status file. This allows hfs to maintain the current directory between invocations and to reset this directory whenever the volume is changed. hfs defaults to using the A: floppy drive. This can be overridden by specifying a filename or device via the HFS_DEVICE environment variable or the -d command line option. The format of device names differs depending upon the operating system. Regardless of the operating system, the special device names A: and B: map to the two floppy drives. The devices used are /dev/fd0H1440 and /dev/fd1H1440 for Linux, A: and B: for MS-DOS, \\\\.\\A: and \\\\.\\B: for Windows NT, and /dev/rfd0.1440 and /dev/rfd1.1440 for FreeBSD. Note that the device used by does not have to be floppy drive. It can just as easily be the name of the CD-ROM device, a normal file or any other accessible device. For instance, to access a CD-ROM, set the device to /dev/sr0 (Linux) or to F: (say) for MS-DOS. All paths specified on the HFS volume assume that the colon (":") character is the directory separator character. The dot (".") character may be used to indicate the current directory, and the double-dot ("..") sequence may be used to indicate the parent directory. Filename globbing accepts the standard Unix wildcard conventions. The current version of hfstools is 0.37

PARTITIONS
hfs can access standard Macintosh partitioned media. Normally the first HFS partition on the device will be used. If more than one HFS partition exists, then the first partition will still be used, but a warning message will be printed every time hfs is invoked. If the HFS_PARTITION environment variable or the -p option is used to specify the partition number, then this warning is supressed. If the partition specified, but is not an HFS partition, then a warning message will be displayed and the the first HFS partition following will be used. Use the command hfs part to display all of the HFS partitions on a device. The -a option can be used to display all partitions regardless of type.

OPTIONS

-a  display all files, including invisible ones. For the part command, display all partition table entries.

-d filename
    use filename as the HFS device. Note that this may be a real file, or a device.

-l  display file information in long format

-p number
    Use the specified partition number on the current device. This overrides the value (if any) of the HFS_PARTITION environment variable.

-t  convert Macintosh end-of-line characters (linefeeds) to the end-of-line sequence appropriate for the host operating system, and convert Macintosh characters to the ISO Latin1 character set.

-x  display the file in hex.

-R  for the ls command, display sub directories recursively. For the read and cat commands, use the resource fork rather than the data fork.

-M  Do not attempt to mangle the filenames to be legal for the native operating system.

ENVIRONMENT

HFS_DEVICE
    Specifies the name of the device used to access the floppy drive.

HFS_PARTITION
    Specifies the number of the partition to use on Macintosh partitioned devices.

HFS_STATUSFILE
    Gives the path and name of the status file used to detect volume changes and the hold the current directory between invocations.

TEMP
    For MS-DOS and NT, specifies the directory to store the status file

FILES

~/.macdir
    Default status file for Unix systems

./macdir.sts
    Default status file for MSDOS and NT systems if no TEMP environment variable set.

$(TEMP)/.macdir.sts
    Default status file for MSDOS and NT systems if TEMP environment variable is set.

/dev/fd0H1440, /dev/fd1H1440
    Floppy disk devices for Linux

/dev/rfd0.1440, /dev/rfd1.1440
    Floppy disk devices for FreeBSD

\\\\.\\A:, \\\\.\\B:
    Floppy disk devices for Windows/NT

BUGS
No functions for writing to the disk at the file level have yet been implemented. Wildcard expansion of HFS filenames has been implemented for the hread command, but not for any other commands. This would be especially useful when entering ISO Latin1 filenames. The usage messages need more work. There is no support for the AppleDouble format. There is no support for MFS disks, and there is probably no need to as there will never be any support for 800K disks.

CREDITS
hfs was originally written by Craig Southeren (craigs@ineluki.apana.org.au). MS-DOS/Windows/NT code, extensive testing and debugging, and C++ coaching by Robert Jongbloed. Thanks to Jean-Marc Zucconi (jmz@cabri.obs-besancon.fr) for the code and help in getting partitioned drives and CD-ROMS working, and for the idea of ISO Latin1 conversion. Thanks to Rich Murphey (rich@lamprey.utmb.edu) for the FreeBSD patches.