Teamprise Knowledge Base

TKB00080 Technical description of Apple file transformation

Last updated 2008-08-19 15:53:25 UTC by Shaw Terwilliger

This document describes the behavior of the "transform=apple" attribute, supported in Teamprise 3.1.1 and later.

Introduction

Teamprise clients on Mac OS X are capable of preserving Apple filesystem metadata, including a file's Resource Fork, Finder Info and Finder Comments when checking in to Team Foundation Server. Preserving this metadata is optional for files and is disabled by default. It must be enabled in the Teamprise extended attributes file.

When enabled, Teamprise clients will create an "AppleSingle" version 2.0 file containing the file's data fork, resource fork and other Apple metadata when checking in to Team Foundation Server. Teamprise clients will then decode this file when a "get" is performed from the Team Foundation Server to recreate the file's forks.

AppleSingle files were chosen for this task as they allow Teamprise clients to represent the various forks in a single file, which allows us clients to maintain the semantics expected by Team Foundation Server.

Operation

Uploads to Team Foundation Server

When configured in the Teamprise extended attributes file, Teamprise clients on Mac OS X will create an AppleSingle file for check-in or shelve operations and upload that to the server. This file will consist of:

  1. A file's data fork
  2. A file's resource fork
  3. Any "Finder Information" for the file (the file creator, the color, etc.)
  4. Any "Finder comments" ("Spotlight comments" in Mac OS 10.4+)

Retrieving from Team Foundation Server

When configured in the Teamprise extended attributes file, Teamprise clients on Mac OS X will examine the file when a get operation is performed. If the file is a Teamprise-created AppleSingle file, it will be decoded into its data fork and resource fork, and any metadata will be saved to the file.

If the file is not a Teamprise-created AppleSingle file, it will simply be treated as an opaque piece of data and written to disk. This allows teams to take a file already existing in a repository and begin preserving resource fork and metadata information for it. It will be converted to AppleSingle format at the next check in.

If the Teamprise extended attributes file does not specify transformation for a file, it will not be examined or converted out of AppleSingle format. Thus, it is important that all members of the team are instructed to perform this transformation, and it is suggested that the Teamprise extended attributes file be checked in to the TFS repository.

Non Mac OS X clients

Teamprise clients on other platforms will ignore AppleSingle files, and will treat them as an opaque piece of data at get or checkin time. This is similar to how non-Teamprise clients will treat the file.

AppleSingle File Format

Teamprise uses the AppleSingle file format to encode file forks and metadata into a single file, suitable for Team Foundation Server. The AppleSingle file format is described in the Apple article "AppleSingle/AppleDouble Formats for Foreign Files Developer's Note".

Teamprise-specific Modifications

Teamprise clients create AppleSingle files that follow the specification set out by Apple, and thus compatible with other AppleSingle decoders, but are unique to facilitate use in Team Foundation Server:

"Teamprise" file system header
Teamprise clients encode AppleSingle files, setting the file system portion of the header to "Teamprise", padded with spaces. Literally:

ASCII T e a m p r i s e
Hex 0x54 0x65 0x61 0x6d 0x70 0x72 0x69 0x73 0x65 0x20 0x20 0x20 0x20 0x20 0x20 0x20

This is done to identify Teamprise-created AppleSingle files and to eliminate the possibility of overlap between files encoded to preserve metadata and literal AppleSingle files checked in to the server. AppleSingle (version 2.0) decoders should ignore this field.

Date Entry
Teamprise clients do not include the date entry in the resultant AppleSingle file. This is done as an optimization, to avoid uploading files when the content has not changed. Encoding the file's date would cause a file upload, as the AppleSingle file would change even when the underlying filesystem content has not changed.

AppleSingle decoder behavior is undefined in this case. The Apple decoder implementation will set the file's date to Jan 1 1970.

Compatibility

AppleSingle files created by Teamprise may be decoded by other tools which can read AppleSingle files, for compatibility purposes. Notable, the standalone "applesingle" command line utility on Mac OS X platforms can decode these files.

Encoding AppleSingle files for Teamprise clients to decode may be more difficult, due to the requirements of the "Teamprise" filesystem header (explained above.)

Products affected:

  • Teamprise Command Line Client
  • Teamprise Explorer
  • Teamprise Plugin for Eclipse

Releases affected:

  • 3.1

Platforms affected:

  • Mac OS X (PowerPC)
  • Mac OS X (x86)

Related articles:

Keywords: apple resource fork data fork finder applesingle appledouble