Skip to content

Resource fork support in Mobius

Jeff Halter edited this page Jan 22, 2024 · 2 revisions

Resource Fork Support in Mobius

Classic Macintosh operating systems store file information in data forks and resource forks, depending on their file type:

A resource fork stores information in a specific form, containing details such as icon bitmaps, the shapes of windows, definitions of menus and their contents, and application code (machine code). For example, a word processing file might store its text in the data fork, while storing any embedded images in the same file's resource fork. The resource fork is used mostly by executables, but every file can have a resource fork.

src: Wikipedia

The Mobius server can optionally preserve or discard resource forks uploaded from classic Macintosh Hotline clients with the PreserveResourceForks setting in the server's config.yaml file.

Before enabling the PreserveResourceForks option, it's important to understand its implications.

PreserveResourceForks: false (default)

When the PreserveResourceForks config setting is false, the Mobius server discards resource forks uploaded from classic Macintosh clients and infers file type/creator codes from common file name extensions (e.g., .jpg, .zip, .txt).

If you are running a server that only deals with data files without resource forks (e.g., .sit, .zip, .mp3) and you do not mind having filename extensions, this setting may be sufficient for your needs.

Pros:

  • One file on disk for each file uploaded, making server-side file management easier.

Cons:

  • Files must have filename extensions.
  • File creator/type information is inferred from a small list of known, common file types.
  • No support for file comments.
  • No support for hosting runnable classic Mac applications.

PreserveResourceForks: true

When PreserveResourceForks is true, the Mobius server will behave identically to the official release Hotline server running on classic Mac OS.

To accomplish this, files uploaded from classic Macintosh clients will be stored on disk in three parts: the data fork, the resource fork, and the information fork.

From the perspective of a Hotline client, these separate files will behave as a single logical file, with operations such as move, rename, and delete acting on all parts of the file.

When a client downloads a file with separate parts, the Mobius server will send the information and resource forks as part of the transfer.

Pros:

  • Authentic server behavior from the perspective of classic Macintosh clients.
  • No filename extensions needed; file types come from the uploading client.
  • Preserves file comments for uploaded files and enables file comment editing.
  • Preserves the ability to upload and download executable files.

Cons:

  • Three files on disk for each uploaded file, making server-side file management more burdensome.