appledouble

package
v0.0.0-...-5b07d03 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DATA_FORK           = 1
	RESOURCE_FORK       = 2
	REAL_NAME           = 3
	COMMENT             = 4
	ICON_BW             = 5
	ICON_COLOR          = 6
	FILE_INFO_V1        = 7 // Old v1 file info combining FILE_DATES_INFO and MACINTOSH_FILE_INFO.
	FILE_DATES_INFO     = 8
	FINDER_INFO         = 9  // FinderInfo (16) + FinderXInfo (16)
	MACINTOSH_FILE_INFO = 10 // 32 bits, bits 31 = protected and 32 = locked
	PRODOS_FILE_INFO    = 11
	MSDOS_FILE_INFO     = 12
	SHORT_NAME          = 13 // AFP short name.
	AFP_FILE_INFO       = 14
	DIRECTORY_ID        = 15 // AFP directory ID.
)
View Source
const (
	FlagIsOnDesk            = 0x0001 // Files and folders (System 6)
	MaskColor               = 0x000E // Files and folders
	FlagRequireSwitchLaunch = 0x0020 // Applications only
	FlagIsShared            = 0x0040 // Applications only
	FlagHasNoINITs          = 0x0080 // Extensions/Control Panels only
	FlagHasBeenInited       = 0x0100 // Files only (all BNDL/FREF/open/kind have been added)
	FlagAOCELetter          = 0x0200 // obsoleted
	FlagHasCustomIcon       = 0x0400 // Files and folders
	FlagIsStationery        = 0x0800 // Files only
	FlagNameLocked          = 0x1000 // Files and folders
	FlagHasBundle           = 0x2000 // Files only
	FlagIsInvisible         = 0x4000 // Files and folders
	FlagIsAlias             = 0x8000 // Files only
	XFlagHasCustomBadge     = 0x0100
	XFlagHasRoutingInfo     = 0x0004
)

Variables

This section is empty.

Functions

func Dump

func Dump(r io.Reader) (string, error)

func MacTime

func MacTime(t uint32) time.Time

func MakePrefix

func MakePrefix(records map[int][]byte, rforkSize, rForkMinOffset int64) (buf []byte, rForkOffset int64)

Slightly peculiar

func Sidecar

func Sidecar(name string) string

Types

type AppleDouble

type AppleDouble struct {
	// Basic filesystem metadata
	CreateTime, ModTime, BkTime, AccTime time.Time
	Locked                               bool

	// Stored in various ways across software versions, nonetheless important
	Comment string

	// File-and-directory FinderInfo
	Flags    uint16
	Location struct{ Y, X int16 }
	XFlags   uint16 // ignore the rarely used "filename display script" function

	// File-only FinderInfo
	Type    [4]byte
	Creator [4]byte

	// Directory-only FinderInfo
	Rect   struct{ T, L, B, R int16 }
	View   int16 // 0 is not a valid value, use 256 (icon view)
	Scroll struct{ Y, X int16 }
}

Everything that we would want to put in an AppleDouble file, except for a resource fork, because that's big. Excludes some of the Finder info fields that become meaningless when moving to a different disk

func (*AppleDouble) ForDir

func (m *AppleDouble) ForDir() (func() (io.Reader, error), int64)

func (*AppleDouble) LoadDInfo

func (m *AppleDouble) LoadDInfo(d *[16]byte)

func (*AppleDouble) LoadDXInfo

func (m *AppleDouble) LoadDXInfo(d *[16]byte)

func (*AppleDouble) LoadFInfo

func (m *AppleDouble) LoadFInfo(d *[16]byte)

func (*AppleDouble) LoadFXInfo

func (m *AppleDouble) LoadFXInfo(d *[16]byte)

func (*AppleDouble) WithResourceFork

func (m *AppleDouble) WithResourceFork(r io.ReaderAt, size int64) (io.ReaderAt, int64)

func (*AppleDouble) WithSequentialResourceFork

func (m *AppleDouble) WithSequentialResourceFork(opener func() (io.ReadCloser, error), size int64) (func() (io.ReadCloser, error), int64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL