📄 hfs.txt
字号:
Macintosh HFS Filesystem for Linux Paul H. Hargrove, hargrove@sccm.Stanford.EDU version 0.95, 28 Apr 1997 This document describes version 0.95 of the Macintosh HFS filesystem for Linux. The most current versions of this document and the software are kept at The HFS for Linux Page <http://www-sccm.Stanford.EDU/~hargrove/HFS/>. ______________________________________________________________________ Table of Contents: 1. Introduction 2. Mounting HFS Filesystems 2.1. afpd 2.2. case={asis, lower} 2.3. conv={auto, binary, text} 2.4. creator=cccc 2.5. fork={cap, double, netatalk} 2.6. gid=n 2.7. names={7bit, 8bit, alpha, cap, latin, netatalk, trivial} 2.8. part=n 2.9. quiet 2.10. type=cccc 2.11. uid=n 2.12. umask=n 3. Writing to HFS Filesystems 3.1. Writing with fork=cap 3.2. Writing with fork=double 3.3. Writing with fork=netatalk 4. A Guide to Special File Formats 4.1. CAP .finderinfo Files 4.2. AppleDouble Header Files 5. Reporting Bugs 5.1. What Goes in a Bug Report 5.2. How to Report a Kernel Oops or GPF 6. Legal Notices 6.1. This Document 6.2. The Software 6.2.1. The Columbia AppleTalk Package for UNIX 6.2.2. Netatalk 6.3. Trademarks ______________________________________________________________________ 11.. IInnttrroodduuccttiioonn This software implements the Macintosh HFS filesystem under Linux. It allows you to read and write HFS filesystems on floppy disks, CDROMs, hard drives, ZIP drives, etc. It is _n_o_t an AppleShare client. If you use this software, please send me a note telling of your success or failure with it. Your feedback lets me know that this project is not a waste of my time. This code is still experimental, so backup anything important before you start playing. I'd like you to know that I've never lost any files while using this software, or I would not release it. However, a ``better safe than sorry'' attitude is probably best. If, for instance, the buffer cache were to become corrupted you could start losing things on other disks. Because of this, if you get a General Protection Fault, or a kernel Oops, I _s_t_r_o_n_g_l_y recommend that you reboot before writing any files. 22.. MMoouunnttiinngg HHFFSS FFiilleessyysstteemmss Once you have the HFS filesystem compiled into the kernel or installed as a loadable module, you will be able to use hfs as a filesystem type option to mount. For instance, to mount a Macintosh floppy disk on the directory /mnt using the default mount options you would execute ``mount -t hfs /dev/fd0 /mnt''. The remainder of this section describes the several mount options available to control how the HFS filesystem is mapped onto a Linux filesystem structure. The values for the multiple-choice options (case, conv, fork and names) can be abbreviated by their first character. 22..11.. aaffppdd If included in the options, then the behavior of the filesystem is changed to make it fully read-write compatible with Netatalk's afpd. In this mode you should not use normal user-level tools to modify the filesystem, though reading from it is acceptable. This is because the return codes from some system calls are changed to fool afpd. These changes will confuse many user-level tools. In particular ``rm -r'' will loop forever. This option implies fork=netatalk, which in turn implies names=netatalk. If either of these options are explicitly set to something else they will take precedence and will confuse afpd. The quiet option has no effect. The case= option functions normally, but afpd usually does the same thing for you. The conv= and part= options also function normally. You will probably want to use the uid=, gid= and umask= mount options. Note that because all the files on an HFS filesystem belong to a single user and group and have a single umask, the full AppleShare permission scheme will not work through Netatalk. One additional limitation is that the Desktop database on the disk is stored in afpd's format and is separate from any existing database maintained by the Finder when the volume is used on a Macintosh. Because of this mounting an HFS CDROM across the network to a Macintosh may result in applications and documents showing up with default application and document icons. Additionally double clicking on a document will fail to start the correct application. Both of these problems can be worked around by copying the application to a local disk on the Macintosh. This mode is known to be compatible with afpd from Netatalk versions 1.4b1 and 1.4b2, and known to be incompatible with the afpd from version 1.3.3. As of this writing Netatalk version 1.4 has not yet been released. However, it is expected that this mode will be compatible with afpd from Netatalk version 1.4 when it is released. 22..22.. ccaassee=={{aassiiss,, lloowweerr}} default value: asis This option determines if Macintosh filenames are presented in their original case or in all lowercase. Filename lookup is always case insensitive, so either way foo and Foo refer to the same file but ls will list Foo with case=asis, and foo with case=lower. (Same as for the HPFS filesystem.) aassiiss Filenames are reported in the case they were created with. lloowweerr Filenames are reported in lowercase. 22..33.. ccoonnvv=={{aauuttoo,, bbiinnaarryy,, tteexxtt}} default value: binary This option controls CR<->NL conversion of Macintosh _d_a_t_a _f_o_r_k_s. Any translation takes place only for files accessed with the read() and write() system calls (either directly or through the stdio functions). Access through mmap() is unaffected. (Similar to the conv= option for the MS-DOS filesystem.) aauuttoo If the Finder's type for a file is TEXT or ttro, then CR characters are converted to NL characters when read, and NL characters are converted to CR characters when written. Be warned that some Macintosh applications create files with type TEXT even though the contents is clearly binary. bbiinnaarryy No CR<->NL conversion is done. tteexxtt In all data forks, regardless of the Finder's type for the file, CR characters are converted to NL characters when read, and NL characters are converted to CR characters when written. 22..44.. ccrreeaattoorr==cccccccc default value: ``????'' Specifies the 4-character string specifying the Finder's Creator for new files. 22..55.. ffoorrkk=={{ccaapp,, ddoouubbllee,, nneettaattaallkk}} default value: cap This option determines how resource forks and the Finder's metadata are represented within the structure of the Linux filesystem. ccaapp The scheme used by the Columbia AppleTalk Package's AUFS. Associated with each directory are two special directories and a metadata file. The directory ./bar is represented by: ..//bbaarr The directory itself, containing subdirectories, the data forks of files, and the following two special directories. ..//bbaarr//..rreessoouurrccee A special directory holding resource forks of the files in ./bar. ..//bbaarr//..ffiinnddeerriinnffoo A special directory holding metadata files for the files and subdirectories in ./bar. ..//..ffiinnddeerriinnffoo//bbaarr The metadata file for the directory ./bar. The files in a directory are represented as three files: ..//ffoooo The data fork of the file ./foo. ..//..rreessoouurrccee//ffoooo The resource fork of the file ./foo. ..//..ffiinnddeerriinnffoo//ffoooo The metadata file for the file ./foo. Additionally, the file .rootinfo in the root directory of the HFS filesystem is a metadata file for the root directory. Brief documentation on the format of file containing the Finder's metadata is included in the section ``A Guide to Special File Formats'' in this document. More detailed information is available in the Columbia AppleTalk Package. ddoouubbllee The ``AppleDouble'' format recommended by Apple. (Apple's other recommended format, ``AppleSingle'', is not yet implemented.) Associated with each directory is an AppleDouble ``header file''. The directory ./bar is represented by: ..//bbaarr The directory itself, containing subdirectories, the data forks for files, and the header files for files and subdirectories. ..//%%bbaarr The header file for the directory ./bar, containing the Finder's metadata for the directory. The files in a directory are represented as two files: ..//ffoooo The data fork of the file ./foo.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -