Open Source .NET Development [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Open Source .NET Development [Electronic resources] - نسخه متنی

Brian Nantz

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید


HFS CREATOR/TYPE


A Macintosh file has two properties associated with it that define which application created the file, the CREATOR, and what data the file contains, the TYPE. Both are (exactly) 4-letter strings. Usually this allows a Macintosh user to double-click on a file and launch the correct application, etc. The CREATOR and TYPE of a particular file can be found by using something like ResEdit (or similar) on a Macintosh.

The CREATOR and TYPE information is stored in all the various Apple/Unix encoded files. For other files, it is possible to base the CREATOR and TYPE on the filename's extension using a mapping file (the -map option) and/or using the magic number (usually a signature in the first few bytes) of a file (the -magic option). If both these options are given, then their order on the command line is important. If the -map option is given first, then a filename extension match is attempted before a magic number match. However, if the -magic option is given first, then a magic number match is attempted before a filename extension match.

If a mapping or magic file is not used, or no match is found, then the default CREATOR and TYPE for all regular files can be set by using entries in the .mkisofsrc file or by using the -hfs-creator and/or -hfs-type options; otherwise the default CREATOR and TYPE are "unix" and "TEXT."

The format of the mapping file is the same afpfile format as used by aufs. This file has five columns for the extension, file translation, CREATOR, TYPE, and Comment. Lines starting with the "#" character are comment lines and are ignored. An example file would be like:

# Example filename mapping file
#
# EXTN XLate CREATOR TYPE Comment
.tif Raw '8BIM' 'TIFF' "Photoshop TIFF image"
.hqx Ascii 'BnHq' 'TEXT' "BinHex file"
.doc Raw 'MSWD' 'WDBN' "Word file"
.mov Raw 'TVOD' 'MooV' "QuickTime Movie"
* Ascii 'ttxt' 'TEXT' "Text file"

Where:

  • The first column EXTN defines the Unix filename extension to be mapped. The default mapping for any filename extension that doesn't match is defined with the "*" character.

  • The Xlate column defines the type of text translation between the Unix and Macintosh file. It is ignored by mkisofs but is kept to be compatible with aufs(1). Although mkisofs does not alter the contents of a file, if a binary file has its TYPE set as 'TEXT,' it may be read incorrectly on a Macintosh. Therefore, a better choice for the default TYPE may be '????'.

  • The CREATOR and TYPE keywords must be 4 characters long and enclosed in single quotes.

  • The comment field is enclosed in double quotes - it is ignored by mkisofs but is kept to be compatible with aufs.


The format of the magic file is almost identical to the magic(4) file used by the Linux file(1) command - the routines for reading and decoding the magic file are based on the Linux file(1) command.

This file has four tab-separated columns for the byte offset, type, test, and message. Lines starting with the "#" character are comment lines and are ignored. An example file would be like:

# Example magic file
#
# off type test message
0 string GIF8 8BIM GIFf GIF image
0 beshort 0xffd8 8BIM JPEG image data
0 string SIT! SIT! SIT! StuffIt Archive
0 string 37235 LZIV ZIVU standard unix compress
0 string 37213 GNUz ZIVU gzip compressed data
0 string %!ASPS TEXT Postscript
0 string 04%! ASPS TEXT PC Postscript with a ^D to start
4 string moov txtt MooV QuickTime movie file (moov)
4 string mdat txtt MooV QuickTime movie file (mdat)

The format of the file is described in the magic(4) man page. The only difference here is that for each entry in the magic file, the message for the initial offset must be 4 characters for the CREATOR, followed by 4 characters for the TYPE - white space is optional between them. Any other characters on this line are ignored. Continuation lines (starting with a '>') are also ignored, i.e., only the initial offset lines are used.

Using the -magic option may significantly increase processing time, as each file has to opened and read to find its magic number.

In summary, for all files, the default CREATOR is 'unix,' and the default TYPE is 'TEXT.' These can be changed by using entries in the .mkisofsrc file or by using the -hfs-creator and/or -hfs-type options.

If the file is in one of the known Apple/Unix formats (and the format has been selected), then the CREATOR and TYPE are taken from the values stored in the Apple/Unix file.

Other files can have their CREATOR and TYPE set from their file name extension (the -map option) or their magic number (the -magic option). If the default match is used in the mapping file, then these values override the default CREATOR and TYPE.

A full CREATOR/TYPE database can be found at http://www.angelfire.com/il/szekely/indexl.


    / 275