MfsReader 1.0.0
dotnet add package MfsReader --version 1.0.0
NuGet\Install-Package MfsReader -Version 1.0.0
<PackageReference Include="MfsReader" Version="1.0.0" />
<PackageVersion Include="MfsReader" Version="1.0.0" />
<PackageReference Include="MfsReader" />
paket add MfsReader --version 1.0.0
#r "nuget: MfsReader, 1.0.0"
#:package MfsReader@1.0.0
#addin nuget:?package=MfsReader&version=1.0.0
#tool nuget:?package=MfsReader&version=1.0.0
MfsReader
A lightweight .NET library for reading classic Macintosh File System (MFS) disk images and extracting their contents. MFS was the original file system used by early Macintosh computers (1984-1985) before being replaced by HFS.
Features
- Read MFS disk images (e.g., 400K floppy disk images)
- Enumerate all files in an MFS volume
- Extract both data and resource forks from files
- Access file metadata (name, type, creator, dates, sizes)
- Support for .NET 9.0
- Zero external dependencies
Installation
Add the project reference to your .NET application:
dotnet add reference path/to/MfsReader.csproj
Or, if published on NuGet:
dotnet add package MfsReader
Usage
Reading an MFS Disk Image
using MfsReader;
// Open a disk image file
using var stream = File.OpenRead("mfs400K.dsk");
// Create an MFS volume reader
var volume = new MFSVolume(stream);
// Get volume information
var mdb = volume.MasterDirectoryBlock;
Console.WriteLine($"Volume Name: {mdb.VolumeName}");
Console.WriteLine($"Created: {mdb.CreationDate}");
Console.WriteLine($"Last Backup: {mdb.LastBackupDate}");
Enumerating Files
// Get all files in the volume
var files = volume.GetEntries();
foreach (var file in files)
{
Console.WriteLine($"File: {file.Name}");
Console.WriteLine($" Type: {file.FileType}");
Console.WriteLine($" Creator: {file.Creator}");
Console.WriteLine($" Data Fork: {file.DataForkSize} bytes");
Console.WriteLine($" Resource Fork: {file.ResourceForkSize} bytes");
Console.WriteLine($" Created: {file.CreationDate}");
Console.WriteLine($" Modified: {file.LastModificationDate}");
}
Extracting File Data
// Extract data fork
foreach (var file in volume.GetEntries())
{
// Get data fork as byte array
byte[] dataFork = volume.GetDataForkData(file);
File.WriteAllBytes($"{file.Name}.data", dataFork);
// Get resource fork as byte array
byte[] resourceFork = volume.GetResourceForkData(file);
File.WriteAllBytes($"{file.Name}.rsrc", resourceFork);
}
Streaming File Data
// Stream file data to an output stream
var file = volume.GetEntries().First();
using var outputStream = File.Create("output.bin");
volume.GetDataForkData(file, outputStream);
API Overview
MFSVolume
The main class for reading MFS volumes.
MFSVolume(Stream stream)- Opens an MFS volume from a streamMasterDirectoryBlock- Gets the master directory block (volume metadata)AllocationBlockMap- Gets the allocation block map of the volumeGetEntries()- Enumerates all file entries in the volumeGetDataForkData(file)- Reads the data fork as a byte arrayGetDataForkData(file, outputStream)- Streams the data fork to an output streamGetResourceForkData(file)- Reads the resource fork as a byte arrayGetResourceForkData(file, outputStream)- Streams the resource fork to an output streamGetFileData(file, forkType)- Reads file data as a byte arrayGetFileData(file, outputStream, forkType)- Streams file data to an output stream
MFSMasterDirectoryBlock
Contains volume-level metadata:
Signature- Volume signature (0xD2D7 for MFS)VolumeName- Name of the volumeCreationDate- Volume creation dateLastBackupDate- Volume last backup dateAttributes- Volume attributes/flagsNumberOfFiles- Number of files in the volumeFileDirectoryStart- Starting sector of the file directoryFileDirectoryLength- Length of the file directory in sectorsNumberOfAllocationBlocks- Number of allocation blocks on the volumeAllocationBlockSize- Size of allocation blocks in bytesClumpSize- Clump size in bytesAllocationBlockStart- Starting sector of the first allocation blockNextFileNumber- Next file number to be assignedFreeAllocationBlocks- Number of free allocation blocks
MFSFileDirectoryBlock
Represents a file entry in the MFS volume:
Name- File name (up to 255 characters)Flags- Entry flags (used, locked)Version- Version numberFileType- Four-character file type codeCreator- Four-character creator codeFinderFlags- Finder flagsParentLocationX- X-coordinate of file's location in parentParentLocationY- Y-coordinate of file's location in parentFolderNumber- Folder numberFileNumber- File numberCreationDate- File creation dateLastModificationDate- File last modified dateDataForkAllocationBlock- Starting allocation block for data forkDataForkSize- Size of the data fork in bytesDataForkAllocatedSize- Allocated size of the data fork in bytesResourceForkAllocationBlock- Starting allocation block for resource forkResourceForkSize- Size of the resource fork in bytesResourceForkAllocatedSize- Allocated size of the resource fork in bytes
Building
Build the project using the .NET SDK:
dotnet build
Run tests:
dotnet test
MFSDumper CLI
Extract an MFS disk image to a directory using the dumper tool.
Install/Build
dotnet build dumper/MFSDumper.csproj -c Release
Usage
MFSDumper \
/path/to/disk.dsk \
-o /path/to/output \
[--data-only | --resource-only]
- Input: Path to the
.dskimage. - Output: Destination directory for extracted files.
- Fork selection:
--data-only: Extract only data forks.--resource-only: Extract only resource forks.
Files are written as <Name>.data and <Name>.res, with / and : replaced by _ for compatibility.
Requirements
- .NET 9.0 or later
License
MIT License. See LICENSE for details.
Copyright (c) 2026 Hugh Bellamy
About MFS
The Macintosh File System (MFS) was the original file system for the Macintosh computer, introduced in 1984. Key characteristics:
- Flat file structure (no subdirectories/folders)
- Support for data and resource forks
- Maximum of 128 files per volume
- Primarily used on 400K floppy disks
- Replaced by HFS (Hierarchical File System) in 1985
Related Projects
- HfsReader - Reader for HFS (Hierarchical File System) volumes
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 77 | 1/11/2026 |