hfsplus

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Copyright (c) 2014, Quamotion Ported from DiscUtils.HfsPlus File.cs / CompressionAttribute (MIT).

Copyright (c) 2008-2011, Kenneth Bell Ported from DiscUtils HFS+ (MIT).

Index

Constants

View Source
const (
	SigHFSPlus = 0x482b
	SigHFSX    = 0x4858
	HeaderOff  = 1024
	HeaderSize = 512

	CNIDRootParent = 1
	CNIDRootFolder = 2
	CNIDExtents    = 3
	CNIDCatalog    = 4
	CNIDBadBlocks  = 5
	CNIDAllocation = 6
	CNIDStartup    = 7
	CNIDAttributes = 8
	CNIDFirstUser  = 16

	AttrJournaled    = 0x00002000
	AttrUnmounted    = 0x00000100
	AttrSoftwareLock = 0x00008000
)

Variables

This section is empty.

Functions

func Format

func Format(c disk.Content, opt Options) error

Format initializes an empty HFS+ (or HFSX) volume on c.

Types

type Extent

type Extent struct {
	StartBlock uint32
	BlockCount uint32
}

type Fork

type Fork struct {
	LogicalSize uint64
	ClumpSize   uint32
	TotalBlocks uint32
	Extents     [8]Extent
}

type Options

type Options struct {
	Name          string
	BlockSize     uint32
	CaseSensitive bool
	Created       time.Time
}

Options for Format.

type Volume

type Volume struct {
	// contains filtered or unexported fields
}

Volume is a mounted HFS+ or HFSX filesystem.

func Mount

func Mount(c disk.Content, writable bool) (*Volume, error)

func (*Volume) CanWrite

func (v *Volume) CanWrite() bool

func (*Volume) Close

func (v *Volume) Close() error

func (*Volume) CreateDir

func (v *Volume) CreateDir(path string) error

func (*Volume) CreateFile

func (v *Volume) CreateFile(path string) error

func (*Volume) Flush

func (v *Volume) Flush() error

func (*Volume) Header

func (v *Volume) Header() VolumeHeader

func (*Volume) MkdirAll

func (v *Volume) MkdirAll(path string) error

func (*Volume) Name

func (v *Volume) Name() string

func (*Volume) OpenFile

func (v *Volume) OpenFile(path string, fork vfs.Fork, flag int) (vfs.File, error)

func (*Volume) ReadDir

func (v *Volume) ReadDir(path string) ([]vfs.FileInfo, error)

func (*Volume) Remove

func (v *Volume) Remove(path string) error

func (*Volume) Rename

func (v *Volume) Rename(oldpath, newpath string) error

func (*Volume) SetInfo

func (v *Volume) SetInfo(path string, info vfs.FileInfo) error

func (*Volume) Stat

func (v *Volume) Stat(path string) (vfs.FileInfo, error)

func (*Volume) VolumeLabel

func (v *Volume) VolumeLabel() string

type VolumeHeader

type VolumeHeader struct {
	Signature          uint16
	Version            uint16
	Attributes         uint32
	LastMountedVersion uint32
	JournalInfoBlock   uint32
	CreateDate         uint32
	ModifyDate         uint32
	BackupDate         uint32
	CheckedDate        uint32
	FileCount          uint32
	FolderCount        uint32
	BlockSize          uint32
	TotalBlocks        uint32
	FreeBlocks         uint32
	NextAllocation     uint32
	RsrcClumpSize      uint32
	DataClumpSize      uint32
	NextCatalogID      uint32
	WriteCount         uint32
	EncodingsBitmap    uint64
	FinderInfo         [8]uint32
	AllocationFile     Fork
	ExtentsFile        Fork
	CatalogFile        Fork
	AttributesFile     Fork
	StartupFile        Fork
}

func ParseHeader

func ParseHeader(b []byte) VolumeHeader

func (VolumeHeader) CaseSensitive

func (h VolumeHeader) CaseSensitive() bool

func (VolumeHeader) Journaled

func (h VolumeHeader) Journaled() bool

func (VolumeHeader) Marshal

func (h VolumeHeader) Marshal() []byte

func (VolumeHeader) Valid

func (h VolumeHeader) Valid() bool

Jump to

Keyboard shortcuts

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