cluster

package
v0.0.0-...-bbc9ce3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package cluster is responsible for opening and using the FAT. The cluster manager is thread-safe.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager builds on top of the FAT, and can operate it on more complex ways.

func Mount

func Mount(c *thinio.Conductor, br *bootrecord.Bootrecord, readonly bool) (*Manager, error)

Mount creates a new manager, which tracks access to the FAT.

func (*Manager) ClusterCollect

func (m *Manager) ClusterCollect(cluster uint32) ([]uint32, error)

ClusterCollect reads all clusters starting from an initial cluster.

If the starting cluster is EOF / free, an empty slice is returned. Returns an error if the cluster chain is malformed or cannot be read.

func (*Manager) ClusterDelete

func (m *Manager) ClusterDelete(cluster uint32) error

ClusterDelete removes all clusters chained together after "cluster". It also frees "cluster".

It's okay to pass an EOF / Free cluster to delete. Nothing happens.

func (*Manager) ClusterEOF

func (m *Manager) ClusterEOF() uint32

ClusterEOF returns the cluster that means "EOF".

func (*Manager) ClusterExtend

func (m *Manager) ClusterExtend(cluster uint32) (uint32, error)

ClusterExtend allocates a new cluster.

If cluster is not an "EOF" value (or zero), the FAT's entry for cluster is updated to point to the NEW cluster. If cluster is an "EOF" (or zero) value, then a new cluster is allocated, but no old cluster is updated.

func (*Manager) ClusterTruncate

func (m *Manager) ClusterTruncate(cluster uint32) error

ClusterTruncate removes all clusters chained together after "cluster". It sets "cluster" to EOF.

It's okay to pass an EOF / Free cluster to truncate. Nothing happens.

func (*Manager) FreeCount

func (m *Manager) FreeCount() (int64, error)

FreeCount returns the number of free clusters stored in fsinfo.

func (*Manager) Unmount

func (m *Manager) Unmount() error

Unmount removes the node manager and prevents the FAT from being referenced.

Directories

Path Synopsis
fat
Package fat contains the actual File Allocation Table used by the FAT filesystem.
Package fat contains the actual File Allocation Table used by the FAT filesystem.
fsinfo
Package fsinfo describes the FAT32-exclusive FSInfo structure
Package fsinfo describes the FAT32-exclusive FSInfo structure

Jump to

Keyboard shortcuts

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