mirror of
https://github.com/depp/syncfiles.git
synced 2024-11-22 19:30:49 +00:00
2 lines
20 KiB
HTML
2 lines
20 KiB
HTML
<!DOCTYPE html> <html lang="en-US"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <title>Archive Formats - SyncFiles Documentation</title> <link rel="shortcut icon" href="/syncfiles/favicon.ico" type="image/x-icon"> <link rel="stylesheet" href="/syncfiles/assets/css/just-the-docs-default.css"> <script type="text/javascript" src="/syncfiles/assets/js/vendor/lunr.min.js"></script> <script type="text/javascript" src="/syncfiles/assets/js/just-the-docs.js"></script> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Begin Jekyll SEO tag v2.8.0 --> <title>Archive Formats | SyncFiles Documentation</title> <meta name="generator" content="Jekyll v4.2.2" /> <meta property="og:title" content="Archive Formats" /> <meta property="og:locale" content="en_US" /> <meta name="description" content="Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description." /> <meta property="og:description" content="Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description." /> <link rel="canonical" href="https://depp.github.io/syncfiles/tech/archive-formats" /> <meta property="og:url" content="https://depp.github.io/syncfiles/tech/archive-formats" /> <meta property="og:site_name" content="SyncFiles Documentation" /> <meta property="og:type" content="website" /> <meta name="twitter:card" content="summary" /> <meta property="twitter:title" content="Archive Formats" /> <script type="application/ld+json"> {"@context":"https://schema.org","@type":"WebPage","description":"Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.","headline":"Archive Formats","url":"https://depp.github.io/syncfiles/tech/archive-formats"}</script> <!-- End Jekyll SEO tag --> </head> <body> <svg xmlns="http://www.w3.org/2000/svg" style="display: none;"> <symbol id="svg-link" viewBox="0 0 24 24"> <title>Link</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"> <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path> </svg> </symbol> <symbol id="svg-search" viewBox="0 0 24 24"> <title>Search</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"> <circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line> </svg> </symbol> <symbol id="svg-menu" viewBox="0 0 24 24"> <title>Menu</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"> <line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line> </svg> </symbol> <symbol id="svg-arrow-right" viewBox="0 0 24 24"> <title>Expand</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"> <polyline points="9 18 15 12 9 6"></polyline> </svg> </symbol> <symbol id="svg-doc" viewBox="0 0 24 24"> <title>Document</title> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file"> <path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><polyline points="13 2 13 9 20 9"></polyline> </svg> </symbol> </svg> <div class="side-bar"> <div class="site-header"> <a href="https://depp.github.io/syncfiles/" class="site-title lh-tight"> SyncFiles Documentation </a> <a href="#" id="menu-button" class="site-button"> <svg viewBox="0 0 24 24" class="icon"><use xlink:href="#svg-menu"></use></svg> </a> </div> <nav role="navigation" aria-label="Main" id="site-nav" class="site-nav"> <ul class="nav-list"><li class="nav-list-item active"><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24"><use xlink:href="#svg-arrow-right"></use></svg></a><a href="https://depp.github.io/syncfiles/tech/" class="nav-list-link">Technical Guide</a><ul class="nav-list "><li class="nav-list-item active"><a href="https://depp.github.io/syncfiles/tech/archive-formats" class="nav-list-link active">Archive Formats</a></li><li class="nav-list-item "><a href="https://depp.github.io/syncfiles/tech/resource-forks" class="nav-list-link">Resource Forks</a></li><li class="nav-list-item "><a href="https://depp.github.io/syncfiles/tech/finder-info" class="nav-list-link">Finder Info</a></li><li class="nav-list-item "><a href="https://depp.github.io/syncfiles/tech/apis" class="nav-list-link">File APIs</a></li><li class="nav-list-item "><a href="https://depp.github.io/syncfiles/tech/filesystems" class="nav-list-link">Filesystems</a></li><li class="nav-list-item "><a href="https://depp.github.io/syncfiles/tech/safe-saving" class="nav-list-link">Safe Saving</a></li></ul></li><li class="nav-list-item"><a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24"><use xlink:href="#svg-arrow-right"></use></svg></a><a href="https://depp.github.io/syncfiles/" class="nav-list-link">Home</a><ul class="nav-list "></ul></li></ul> </nav> <footer class="site-footer"> This site uses <a href="https://github.com/pmarsceill/just-the-docs">Just the Docs</a>, a documentation theme for Jekyll. </footer> </div> <div class="main" id="top"> <div id="main-header" class="main-header"> <div class="search"> <div class="search-input-wrap"> <input type="text" id="search-input" class="search-input" tabindex="0" placeholder="Search SyncFiles Documentation" aria-label="Search SyncFiles Documentation" autocomplete="off"> <label for="search-input" class="search-label"><svg viewBox="0 0 24 24" class="search-icon"><use xlink:href="#svg-search"></use></svg></label> </div> <div id="search-results" class="search-results"></div> </div> </div> <div id="main-content-wrap" class="main-content-wrap"> <nav aria-label="Breadcrumb" class="breadcrumb-nav"> <ol class="breadcrumb-nav-list"> <li class="breadcrumb-nav-list-item"><a href="https://depp.github.io/syncfiles/tech/">Technical Guide</a></li> <li class="breadcrumb-nav-list-item"><span>Archive Formats</span></li> </ol> </nav> <div id="main-content" class="main-content" role="main"> <h1 id="archive-formats"> <a href="#archive-formats" class="anchor-heading" aria-labelledby="archive-formats"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Archive Formats </h1> <p>Files on old Macintosh systems often have metadata and extra data streams that they need in order to work correctly. If you copy a file from an old Macintosh computer to a Windows or Linux computer, and back, the extra data will be lost and the file may not work correctly.</p> <p>The extra data that Macintosh archive formats must preserve are the file type code and creator code (see <a href="/syncfiles/tech/finder-info">Finder Info</a>) and the resource fork (see <a href="/syncfiles/tech/resource-forks">Resource Forks</a>).</p> <p>Files don’t always need special treatment. Plain text files and common image formats like PNG and JPEG are pure data. With software like PC Exchange or Software Exchange, the system can automatically set the file type code and creator code from the file’s extension. This is all you need for plain text, PNG, JPEG, and various other formtas.</p> <p>However, applications and most types of files will not work correctly if the extra is lost. Archive formats provide ways to preserve this data.</p> <h2 id="which-format-should-i-use"> <a href="#which-format-should-i-use" class="anchor-heading" aria-labelledby="which-format-should-i-use"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Which Format Should I Use? </h2> <p>This is a matter of opinion! However, some choices are better than others.</p> <ol> <li> <p><strong>Raw disk image</strong> (extension <code class="language-plaintext highlighter-rouge">.img</code>, or sometimes <code class="language-plaintext highlighter-rouge">.dsk</code>) is the first choice you should consider. Raw disk images are easy to create, preserve all data, and can be used almost anywhere. Note that not all <code class="language-plaintext highlighter-rouge">.img</code> files are raw disk images.</p> </li> <li> <p><strong>UDIF disk images</strong> (extension <code class="language-plaintext highlighter-rouge">.dmg</code>) are preferred for archiving and distributing software for Mac OS X.</p> </li> <li> <p><strong>NDIF disk images with MacBinary</strong> (extension <code class="language-plaintext highlighter-rouge">.img.bin</code>) are useful for uploading and sharing software and files for Mac OS 9 and earlier.</p> </li> </ol> <h2 id="what-should-i-avoid"> <a href="#what-should-i-avoid" class="anchor-heading" aria-labelledby="what-should-i-avoid"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> What Should I Avoid? </h2> <ul> <li> <p>Don’t transfer NDIF disk images without preserving the image’s resource fork.</p> </li> <li> <p>Don’t double-encode files. Stuffit archives do not need any further encoding. Rather than using <code class="language-plaintext highlighter-rouge">.sit.bin</code> or <code class="language-plaintext highlighter-rouge">.sit.hqx</code>, just use <code class="language-plaintext highlighter-rouge">.sit</code>.</p> </li> </ul> <h2 id="disk-images"> <a href="#disk-images" class="anchor-heading" aria-labelledby="disk-images"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Disk Images </h2> <p>A disk image contains a complete copy of an HFS volume or other filesystem, stored as a file.</p> <h3 id="raw-disk-image"> <a href="#raw-disk-image" class="anchor-heading" aria-labelledby="raw-disk-image"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Raw Disk Image </h3> <p>A raw disk image is a complete HFS (or other) filesystem, stored as a file. Raw disk are easy to create and can be used by emulators, vintage computers, and tools on modern computers. Raw disk images can be safely transferred to other systems without losing data. Note that files which have been deleted can sometimes be restored from raw disk images! DiskCopy lets you avoid this by choosing the “zero blocks” option, which is enabled by default.</p> <p>Raw disk images often use the file extension <code class="language-plaintext highlighter-rouge">.img</code> or <code class="language-plaintext highlighter-rouge">.dsk</code>. You may find it useful to name your raw images with the <code class="language-plaintext highlighter-rouge">.dsk</code> extension to distinguish raw disk images from NDIF disk images.</p> <p>You can create an empty raw disk image using DiskCopy, or create one from the contents of a folder. DiskCopy creates raw disk images when you choose a “read/write” image format.</p> <p>The <a href="https://www.mars.org/home/rob/proj/hfs/">HFS Utilities</a> package provides tools for moving data to and from raw disk images.</p> <h3 id="diskcopy-42-disk-image"> <a href="#diskcopy-42-disk-image" class="anchor-heading" aria-labelledby="diskcopy-42-disk-image"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> DiskCopy 4.2 Disk Image </h3> <p>A DiskCopy 4.2 Disk image contains an image of a floppy disk, plus some metadata like data checksums. DiskCopy 4.2 images are supported by Mini vMac. They contain resource forks, but the image can be used even if the resource fork is deleted.</p> <h3 id="ndif-disk-image"> <a href="#ndif-disk-image" class="anchor-heading" aria-labelledby="ndif-disk-image"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> NDIF Disk Image </h3> <p><img src="diskcopy.png" alt="DiskCopy and a DiskCopy image" /></p> <p>An NDIF image contains a modified version of an HFS filesystem with additional metadata, such as checksums, stored in the file’s resource fork. This additional data appears to be stored in a 200-byte <code class="language-plaintext highlighter-rouge">'bcem'</code> resource with ID 128, but NDIF is not publicly documented and it is a matter of guesswork. If you delete the <code class="language-plaintext highlighter-rouge">'bcem'</code> resource, the disk image will not mount.</p> <p>NDIF images can be compressed. If you want to transfer NDIF images to other systems, encode them with MacBinary (or another encoding that preserves the resource fork).</p> <h3 id="udif-disk-image"> <a href="#udif-disk-image" class="anchor-heading" aria-labelledby="udif-disk-image"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> UDIF Disk Image </h3> <p>A UDIF disk image is like an NDIF disk image, but contains all of its data in the data fork. UDIF appeared on Mac OS X, although it is reportedly possible to use them on Mac OS 9. You can also mount a UDIF image in Mac OS X and access the mounted image from the Classic environment.</p> <p>UDIF disk images use the file extension <code class="language-plaintext highlighter-rouge">.dmg</code>. UDIF images are compressed by default.</p> <h3 id="self-mounting-image"> <a href="#self-mounting-image" class="anchor-heading" aria-labelledby="self-mounting-image"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Self-Mounting Image </h3> <p>Self-mounting images typically use the extension <code class="language-plaintext highlighter-rouge">.smi</code>. Self-mounting images are applications. Running the application mounts the image.</p> <h3 id="iso-toast"> <a href="#iso-toast" class="anchor-heading" aria-labelledby="iso-toast"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> ISO, Toast </h3> <p>ISO and Toast images are disk images created for burning optical disks.</p> <h2 id="single-file-encodings"> <a href="#single-file-encodings" class="anchor-heading" aria-labelledby="single-file-encodings"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Single-File Encodings </h2> <p>If you just need to preserve the Macintosh metadata for a single file, there are three common options.</p> <h3 id="macbinary"> <a href="#macbinary" class="anchor-heading" aria-labelledby="macbinary"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> MacBinary </h3> <p><img src="macbinary.png" alt="MacBinary and a MacBinary encoded file" /></p> <p>MacBinary combines a file’s data fork, resource fork, and metadata into a single file. It is the preferred encoding for transferring individual Macintosh files between systems or for working with Macintosh files on non-Macintosh systems.</p> <p>MacBinary uses the <code class="language-plaintext highlighter-rouge">.bin</code> extension.</p> <p>Note that if a file format has a well-known extension and does not need its resource fork, MacBinary is unnecessary. There is no point in creating a <code class="language-plaintext highlighter-rouge">.sit.bin</code> file, for example. This increases the file size but does not provide any benefits.</p> <h3 id="binhex"> <a href="#binhex" class="anchor-heading" aria-labelledby="binhex"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> BinHex </h3> <p>BinHex combines a file’s data fork, resource fork, and metadata into a single file. The result is encoded as pure ASCII text, which increases the file size, but allows BinHex files to be transferred over old email systems or newsgroups without being damaged. Old email systems are not <em>8-bit clean</em> and would only transmit the low 7 bits of each byte. This worked for pure ASCII text files, but would mangle most other types of files. BinHex also uses a simple run-length encoding and stores CRC checksums of the data.</p> <p>BinHex uses the <code class="language-plaintext highlighter-rouge">.hqx</code> extension.</p> <p>It is common to see BinHex files on old websites, but the format has been superceded by MacBinary.</p> <p>Note that it is not necessary or useful to encode Stuffit archives with BinHex, unless you are transferring data across a 7-bit connection (which is unlikely). If you see a <code class="language-plaintext highlighter-rouge">.sit.hqx</code> file, it can be safely decoded to a <code class="language-plaintext highlighter-rouge">.sit</code> file, even on non-Macintosh systems.</p> <h3 id="appledouble-applesingle"> <a href="#appledouble-applesingle" class="anchor-heading" aria-labelledby="appledouble-applesingle"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> AppleDouble, AppleSingle </h3> <p>AppleDouble is likely the most ubiquitous format for preserving Macintosh metadata, because it’s still used by modern versions of macOS to preserve medatada in zip files, on network shares, and on disk volumes formatted with non-Macintosh filesystems like FAT. AppleDouble is also used by A/UX.</p> <p>AppleDouble is called “AppleDouble” because the data and metadata are stored in separate files. AppleSingle uses the same format, but stores the data and metadata in one file. AppleDouble is convenient because it lets you use the same files from both a Macintosh system and another system.</p> <p>There is no standard file extension for AppleDouble files, but there is a standard prefix, which is <code class="language-plaintext highlighter-rouge">._</code>. If you save a file named <code class="language-plaintext highlighter-rouge">MyFile</code> on a FAT filesystem or Samba network share, Mac OS X will also create an AppleDouble file named <code class="language-plaintext highlighter-rouge">._MyFile</code>, if necessary. If you have used flash drives or network shares to share files between Mac OS X and other systems like Linux or Windows, you have problably seen these AppleDouble files (and the related <code class="language-plaintext highlighter-rouge">.DS_Store</code> files).</p> <h2 id="compression-formats"> <a href="#compression-formats" class="anchor-heading" aria-labelledby="compression-formats"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Compression Formats </h2> <h3 id="stuffit"> <a href="#stuffit" class="anchor-heading" aria-labelledby="stuffit"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Stuffit </h3> <p><img src="stuffit.png" alt="Stuffit Expander and a Stuffit archive" /></p> <p>Stuffit is the more popular compression program for the Macintosh during the 1990s and late 1980s. Stuffit archives use the <code class="language-plaintext highlighter-rouge">.sit</code> extension. Stuffit fell out of use after Apple released Mac OS X, and was replaced by <code class="language-plaintext highlighter-rouge">.zip</code> and <code class="language-plaintext highlighter-rouge">.dmg</code>.</p> <p>Most Mac files shared on websites are compressed using Stuffit.</p> <h3 id="compact-pro"> <a href="#compact-pro" class="anchor-heading" aria-labelledby="compact-pro"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Compact Pro </h3> <p>Compact Pro is a compression program which was somewhat less popular than Stuffit. Compact Pro archives use the <code class="language-plaintext highlighter-rouge">.cpt</code> extension.</p> <h3 id="packit"> <a href="#packit" class="anchor-heading" aria-labelledby="packit"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> PackIt </h3> <p>PackIt is an early compression program for Macintosh. Files are compressed using simple Huffman coding. PackIt archives use the <code class="language-plaintext highlighter-rouge">.pit</code> extension. PackIt archives are rare.</p> </div> </div> <div class="search-overlay"></div> </div> </body> </html>
|