3

Lately I've become interested in the ability of several filesystems including Apple's HFS+ and Microsoft's NTFS which support two or more data streams.

  • In Mac terminology these were most widely known before OS X as the separate data and resource forks. I believe modern HFS+ can have more than two forks.
  • In NTFS they are most commonly referred to as Alternate Data Streams or just ADS.

I'd like to know which, if any, archive/compression formats and/or tools support creating single compressed files from files using the above features for two or more forks or streams.

I know there were some in the Mac System 7 days such as MacBinary and BinHex but I'd like to know if any of the current generation of formats and tools such as zip, gzip, bzip2, 7zip, or any lesser known ones have such support.

I'd prefer open-source, cross-platform, open standards, but anything is interesting.

1 Answer 1

1

I found one option: the open source 7-zip (16.04 at least) can create ".wim" archives, including with support of Alternate Data Streams. There's a "Store alternate data streams" checkbox in the GUI, and a -sfs flag in the CLI. Too bad these are not compressed.

The ".wim" file format is quite well documented.

My recommendation would be to stick to the naming convention used by Windows 2000 Advanced Server, which had optional support for the Apple Filing Protocol, and mapped

  • Traditional MacOS file info to a 60-octet AFP_AfpInfo ADS, e.g.
    41 46 50 00 00 00 01 00 00 00 00 00 00 00 00 80     AFP
    72 6F 68 64 64 64 73 6B 01 00 FF FF FF FF 00 00     rohdddsk
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    E0 D8 D8 AF AE 7F 00 00 3F DE D5 95
    
  • Traditional MacOS resource forks to an AFP_Resource ADS; this is a straight dump of the resource fork octets, usually starting with 00 00 01 00 which is the 32-bit offset in big-endian format of Resource Forks.
  • Traditional MacOS file comments to a Comments ADS (each ASCII character appears as its ASCII code followed by a 00, that is UTF-16 little-endian; I do not know the mapping of Maintosh special characters)

e.g., as shown by Sysinternals's streams utility:

R:\macdev\UniversalInterfaces3.4.1b3.img:
     :AFP_AfpInfo:$DATA 60
    :AFP_Resource:$DATA 3565
        :Comments:$DATA 238

I recently tried to put up a question asking for something on that tune, with compression; but it was (understandably) put on hold.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .