udf

package
v2.24.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileModeOtherOffset = 5 * iota
	FileModeGroupOffset
	FileModeOwnerOffset
)
View Source
const (
	FileModeOtherMask = ((1 << 5) - 1) << (5 * iota)
	FileModeGroupMask
	FileModeOwnerMask
)

Variables

This section is empty.

Functions

func FromFileMode

func FromFileMode(mode FileMode) fs.FileMode

Types

type AnchorVolumeDescriptorPointer

type AnchorVolumeDescriptorPointer struct {
	Tag                             DescriptorTag
	MainVolumeDescriptorSequence    Extent
	ReserveVolumeDescriptorSequence Extent
}

AnchorVolumeDescriptorPointer structure shall only be recorded at 2 of the following 3 locations on the media: * Logical Sector 256. * Logical Sector (N - 256). * N

func (*AnchorVolumeDescriptorPointer) GetIdentifier

func (d *AnchorVolumeDescriptorPointer) GetIdentifier() int

func (*AnchorVolumeDescriptorPointer) GetTag

type CdromBootVolumeDescriptor

type CdromBootVolumeDescriptor struct {
	Header CdromVolumeDescriptorHeader
}

func (*CdromBootVolumeDescriptor) GetHeader

type CdromCdwVolumeDescriptor

type CdromCdwVolumeDescriptor struct {
	Header CdromVolumeDescriptorHeader
}

func (*CdromCdwVolumeDescriptor) GetHeader

type CdromDescriptor

type CdromDescriptor interface {
	GetHeader() *CdromVolumeDescriptorHeader
}

type CdromDescriptorList

type CdromDescriptorList []CdromDescriptor

type CdromExtendedAreaVolumeDescriptor

type CdromExtendedAreaVolumeDescriptor struct {
	Header CdromVolumeDescriptorHeader
}

func (*CdromExtendedAreaVolumeDescriptor) GetHeader

type CdromNsrVolumeDescriptor

type CdromNsrVolumeDescriptor struct {
	Header CdromVolumeDescriptorHeader
}

func (*CdromNsrVolumeDescriptor) GetHeader

type CdromTerminalVolumeDescriptor

type CdromTerminalVolumeDescriptor struct {
	Header CdromVolumeDescriptorHeader
}

func (*CdromTerminalVolumeDescriptor) GetHeader

type CdromVolumeDescriptorHeader

type CdromVolumeDescriptorHeader struct {
	Type       uint8
	Identifier string
	Version    uint8
}

type Charspec

type Charspec struct {
	// CharacterSetType field shall have the value of 0 to indicate the CS0 coded character set.
	CharacterSetType uint8
	// CharacterSetInfo field shall contain the following byte values with the remainder of the field set to a value of 0:
	// #4F, #53, #54, #41, #20, #43, #6F, #6D, #70, #72, #65, #73, #73,
	// #65, #64, #20, #55, #6E, #69, #63, #6F, #64, #65
	CharacterSetInfo []byte
}

type Descriptor

type Descriptor interface {
	GetIdentifier() int
	GetTag() *DescriptorTag
}

func NewDescriptor

func NewDescriptor(tagId uint16) Descriptor

type DescriptorList

type DescriptorList []Descriptor

type DescriptorTag

type DescriptorTag struct {
	TagIdentifier     uint16
	DescriptorVersion uint16
	// This field shall specify the sum modulo 256 of bytes 0-3 and 5-15 of the tag.
	TagChecksum     uint8
	TagSerialNumber uint16
	// This field shall specify the CRC of the bytes of the descriptor starting at the first byte after the descriptor tag.
	// The CRC shall be 16 bits long and be generated by the CRC-ITU-T polynomial
	DescriptorCRC uint16
	// The number of bytes shall be specified by the Descriptor CRC Length field.
	DescriptorCRCLength uint16
	TagLocation         uint32
}

DescriptorTag Certain descriptors specified in Part 3 have a 16 byte structure, or tag, recorded at the start of the descriptor.

type EntityID

type EntityID struct {
	Flags            uint8
	Identifier       string
	IdentifierSuffix string
}

type ExtendedAttributeHeaderDescriptor

type ExtendedAttributeHeaderDescriptor struct {
	Tag                              DescriptorTag
	ImplementationAttributesLocation uint32
	ApplicationAttributesLocation    uint32
}

func (*ExtendedAttributeHeaderDescriptor) GetIdentifier

func (d *ExtendedAttributeHeaderDescriptor) GetIdentifier() int

func (*ExtendedAttributeHeaderDescriptor) GetTag

type Extent

type Extent struct {
	Length   uint32
	Location uint32
}

type ExtentLong

type ExtentLong struct {
	Length   uint32
	Location uint64
}

type FileCharacteristics

type FileCharacteristics uint8
const (
	// FileCharacteristicHidden If set to ZERO, shall mean that the existence of the file shall be made known
	// to the user; If set to ONE, shall mean that the existence of the file need not be made known to the user.
	FileCharacteristicHidden FileCharacteristics = 1 << (0 + iota)

	// FileCharacteristicDirectory If set to ZERO, shall mean that the file is not a directory (see 4/14.6.6);
	// If set to ONE, shall mean that the file is a directory.
	FileCharacteristicDirectory

	// FileCharacteristicDeleted If set to ONE, shall mean this File Identifier Descriptor identifies a file that
	// has been deleted; If set to ZERO, shall mean that this File Identifier Descriptor identifies a file that
	// has not been deleted.
	FileCharacteristicDeleted

	// FileCharacteristicParent If set to ONE, shall mean that the ICB field of this descriptor identifies the
	// ICB associated with the file in which is recorded the parent directory of the directory that this
	// descriptor is recorded in;
	// If set to ZERO, shall mean that the ICB field identifies the ICB associated with the file specified
	// by this descriptor
	FileCharacteristicParent

	// FileCharacteristicMetadata If this File Identifier Descriptor is not in a stream directory,
	// this bit shall be set to ZERO. If this File Identifier Descriptor is in a stream directory,
	// a value of ZERO shall indicate that this stream contains user data. A value of ONE shall indicate that the
	// stream contains implementation use data.
	FileCharacteristicMetadata
)

func (FileCharacteristics) HasFlags

func (c FileCharacteristics) HasFlags(mask FileCharacteristics) bool

type FileEntryDescriptor

type FileEntryDescriptor struct {
	Tag                           DescriptorTag
	ICBTag                        ICBTag
	Uid                           uint32
	Gid                           uint32
	Permissions                   FileMode
	FileLinkCount                 uint16
	RecordFormat                  uint8
	RecordDisplayAttributes       uint8
	RecordLength                  uint32
	InformationLength             uint64
	LogicalBlocksRecorded         uint64
	AccessTime                    time.Time
	ModificationTime              time.Time
	AttributeTime                 time.Time
	Checkpoint                    uint32
	ExtendedAttributeICB          ExtentLong
	ImplementationIdentifier      EntityID
	UniqueID                      uint64
	LengthOfExtendedAttributes    uint32
	LengthOfAllocationDescriptors uint32
	ExtendedAttributes            []byte
	AllocationDescriptors         []Extent
}

func (*FileEntryDescriptor) GetIdentifier

func (d *FileEntryDescriptor) GetIdentifier() int

func (*FileEntryDescriptor) GetTag

func (d *FileEntryDescriptor) GetTag() *DescriptorTag

type FileIdentifierDescriptor

type FileIdentifierDescriptor struct {
	Tag                       DescriptorTag
	FileVersionNumber         uint16
	FileCharacteristics       FileCharacteristics
	LengthOfFileIdentifier    uint8
	ICB                       ExtentLong
	LengthOfImplementationUse uint16
	ImplementationUse         []byte
	FileIdentifier            string
}

FileIdentifierDescriptor ECMA 167 4/14.4

func (*FileIdentifierDescriptor) GetIdentifier

func (d *FileIdentifierDescriptor) GetIdentifier() int

func (*FileIdentifierDescriptor) GetTag

type FileInfo

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

func (*FileInfo) FileMode

func (f *FileInfo) FileMode() fs.FileMode

func (*FileInfo) Gid

func (f *FileInfo) Gid() uint32

func (*FileInfo) IsDir

func (f *FileInfo) IsDir() bool

func (*FileInfo) IsRoot

func (f *FileInfo) IsRoot() bool

func (*FileInfo) ModTime

func (f *FileInfo) ModTime() time.Time

func (*FileInfo) Mode

func (f *FileInfo) Mode() FileMode

func (*FileInfo) Name

func (f *FileInfo) Name() string

func (*FileInfo) Path

func (f *FileInfo) Path() string

func (*FileInfo) Size

func (f *FileInfo) Size() int64

func (*FileInfo) Sys

func (f *FileInfo) Sys() any

func (*FileInfo) Uid

func (f *FileInfo) Uid() uint32

type FileMode

type FileMode uint32

func ToFileMode

func ToFileMode(mode fs.FileMode) FileMode

func (FileMode) Group

func (m FileMode) Group() FileMode

func (FileMode) HasGroup

func (m FileMode) HasGroup(perms FilePerm) bool

func (FileMode) HasOther

func (m FileMode) HasOther(perms FilePerm) bool

func (FileMode) HasOwner

func (m FileMode) HasOwner(perms FilePerm) bool

func (FileMode) Other

func (m FileMode) Other() FileMode

func (FileMode) Owner

func (m FileMode) Owner() FileMode

func (FileMode) SetGroup

func (m FileMode) SetGroup(perms FilePerm) FileMode

func (FileMode) SetOther

func (m FileMode) SetOther(perms FilePerm) FileMode

func (FileMode) SetOwner

func (m FileMode) SetOwner(perms FilePerm) FileMode

func (FileMode) UnsetGroup

func (m FileMode) UnsetGroup(perms FilePerm) FileMode

func (FileMode) UnsetOther

func (m FileMode) UnsetOther(perms FilePerm) FileMode

func (FileMode) UnsetOwner

func (m FileMode) UnsetOwner(perms FilePerm) FileMode

type FilePerm

type FilePerm uint32
const (
	FilePermExecute FilePerm = 1 << iota
	FilePermWrite
	FilePermRead
	FilePermChange
	FilePermDelete
)

type FileSetDescriptor

type FileSetDescriptor struct {
	Tag                                 DescriptorTag
	RecordingDateTime                   time.Time
	InterchangeLevel                    uint16
	MaximumInterchangeLevel             uint16
	CharacterSetList                    uint32
	MaximumCharacterSetList             uint32
	FileSetNumber                       uint32
	FileSetDescriptorNumber             uint32
	LogicalVolumeIdentifierCharacterSet Charspec
	LogicalVolumeIdentifier             string
	FileSetCharacterSet                 Charspec
	FileSetIdentifier                   string
	CopyrightFileIdentifier             string
	AbstractFileIdentifier              string
	RootDirectoryICB                    ExtentLong
	DomainIdentifier                    EntityID
	NextExtent                          ExtentLong
	SystemStreamDirectoryICB            ExtentLong
}

FileSetDescriptor Only one File Set Descriptor shall be recorded. On WORM media, multiple File Sets may be recorded.

func (*FileSetDescriptor) GetIdentifier

func (d *FileSetDescriptor) GetIdentifier() int

func (*FileSetDescriptor) GetTag

func (d *FileSetDescriptor) GetTag() *DescriptorTag

type ICBTag

type ICBTag struct {
	PriorRecordedNumberOfDirectEntries uint32
	StrategyType                       uint16
	StrategyParameter                  uint16
	MaximumNumberOfEntries             uint16
	FileType                           uint8
	ParentICBLocation                  LogicalBlockAddress
	Flags                              uint16
}

type ImageReader

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

func Open

func Open(reader io.ReaderAt) (r *ImageReader, err error)

func (*ImageReader) NewFileReader

func (r *ImageReader) NewFileReader(file *FileInfo) (fileReader io.Reader, err error)

func (*ImageReader) ReadDir

func (r *ImageReader) ReadDir(parent *FileInfo) (children []FileInfo, err error)

func (*ImageReader) RootDir

func (r *ImageReader) RootDir() (fi *FileInfo, err error)

type ImplementationUse

type ImplementationUse struct {
	Entity EntityID
	// Additional vendor-specific data
	Implementation []byte
}

type ImplementationUseExtendedAttribute

type ImplementationUseExtendedAttribute struct {
	AttributeType            uint32
	AttributeSubtype         uint8
	AttributeLength          uint32
	ImplementationUseLength  uint32
	ImplementationIdentifier EntityID
	ImplementationData       []byte
}

type ImplementationUseVolumeDescriptor

type ImplementationUseVolumeDescriptor struct {
	Tag                            DescriptorTag
	VolumeDescriptorSequenceNumber uint32
	ImplementationIdentifier       EntityID
	ImplementationUse              LVInformation
}

ImplementationUseVolumeDescriptor shall be recorded on every Volume of a Volume Set. The Volume may also contain additional Implementation Use Volume Descriptors which are implementation specific. The intended purpose of this descriptor is to aid in the identification of a Volume within a Volume Set that belongs to a specific Logical Volume.

func (*ImplementationUseVolumeDescriptor) GetIdentifier

func (d *ImplementationUseVolumeDescriptor) GetIdentifier() int

func (*ImplementationUseVolumeDescriptor) GetTag

type LVInformation

type LVInformation struct {
	LVICharset              Charspec
	LogicalVolumeIdentifier string
	LVInfo1                 string
	LVInfo2                 string
	LVInfo3                 string
	ImplementationID        EntityID
	ImplementationUse       []byte
}

type LogicalBlockAddress

type LogicalBlockAddress struct {
	LogicalBlockNumber       uint32
	PartitionReferenceNumber uint16
}

type LogicalVolumeDescriptor

type LogicalVolumeDescriptor struct {
	Tag                            DescriptorTag
	VolumeDescriptorSequenceNumber uint32
	DescriptorCharacterSet         Charspec
	LogicalVolumeIdentifier        string
	LogicalBlockSize               uint32
	DomainIdentifier               EntityID
	LogicalVolumeContentsUse       []byte
	MapTableLength                 uint32
	NumberOfPartitionMaps          uint32
	ImplementationIdentifier       EntityID
	ImplementationUse              []byte
	IntegritySequenceExtent        Extent
	PartitionMaps                  []PartitionMap
}

func (*LogicalVolumeDescriptor) GetIdentifier

func (d *LogicalVolumeDescriptor) GetIdentifier() int

func (*LogicalVolumeDescriptor) GetTag

type LogicalVolumeHeaderDescriptor

type LogicalVolumeHeaderDescriptor struct {
	UniqueID uint64
}

type LogicalVolumeIntegrityDescriptor

type LogicalVolumeIntegrityDescriptor struct {
	Tag                       DescriptorTag
	RecordingDateTime         time.Time
	IntegrityType             uint32
	NextIntegrityExtent       Extent
	LogicalVolumeContentsUse  LogicalVolumeHeaderDescriptor
	NumberOfPartitions        uint32
	LengthOfImplementationUse uint32
	FreeSpaceTable            []uint32
	SizeTable                 []uint32
	ImplementationUse         ImplementationUse
}

func (*LogicalVolumeIntegrityDescriptor) GetIdentifier

func (d *LogicalVolumeIntegrityDescriptor) GetIdentifier() int

func (*LogicalVolumeIntegrityDescriptor) GetTag

type PartitionDescriptor

type PartitionDescriptor struct {
	Tag                            DescriptorTag
	VolumeDescriptorSequenceNumber uint32
	PartitionFlags                 uint16
	PartitionNumber                uint16
	PartitionContents              EntityID
	PartitionContentsUse           []byte
	AccessType                     uint32
	PartitionStartingLocation      uint32
	PartitionLength                uint32
	ImplementationIdentifier       EntityID
	ImplementationUse              []byte
}

PartitionDescriptor A Partition Access Type of Read-Only , Rewritable, Overwritable and WORM shall be supported. There shall be exactly one prevailing Partition Descriptor recorded per volume, with one exception. For Volume Sets that consist of single volume, the volume may contain 2 Partitions with 2 prevailing Partition Descriptors only if one has an access type of read only and the other has an access type of Rewritable or Overwritable. The Logical Volume for this volume would consist of the contents of both partitions.

func (*PartitionDescriptor) GetIdentifier

func (d *PartitionDescriptor) GetIdentifier() int

func (*PartitionDescriptor) GetTag

func (d *PartitionDescriptor) GetTag() *DescriptorTag

type PartitionMap

type PartitionMap struct {
	PartitionMapType     uint8
	PartitionMapLength   uint8
	VolumeSequenceNumber uint16
	PartitionNumber      uint16
}

type PrimaryVolumeDescriptor

type PrimaryVolumeDescriptor struct {
	Tag                                         DescriptorTag
	VolumeDescriptorSequenceNumber              uint32
	PrimaryVolumeDescriptorNumber               uint32
	VolumeIdentifier                            string
	VolumeSequenceNumber                        uint16
	MaximumVolumeSequenceNumber                 uint16
	InterchangeLevel                            uint16
	MaximumInterchangeLevel                     uint16
	CharacterSetList                            uint32
	MaximumCharacterSetList                     uint32
	VolumeSetIdentifier                         string
	DescriptorCharacterSet                      Charspec
	ExplanatoryCharacterSet                     Charspec
	VolumeAbstract                              Extent
	VolumeCopyrightNoticeExtent                 Extent
	ApplicationIdentifier                       EntityID
	RecordingDateTime                           time.Time
	ImplementationIdentifier                    EntityID
	ImplementationUse                           []byte
	PredecessorVolumeDescriptorSequenceLocation uint32
	Flags                                       uint16
}

PrimaryVolumeDescriptor There shall be exactly one prevailing Primary Volume Descriptor recorded per volume.

func (*PrimaryVolumeDescriptor) GetIdentifier

func (d *PrimaryVolumeDescriptor) GetIdentifier() int

func (*PrimaryVolumeDescriptor) GetTag

type TerminatingDescriptor

type TerminatingDescriptor struct {
	Tag DescriptorTag
}

TerminatingDescriptor may be recorded to terminate a Volume Descriptor Sequence

func (*TerminatingDescriptor) GetIdentifier

func (d *TerminatingDescriptor) GetIdentifier() int

func (*TerminatingDescriptor) GetTag

func (d *TerminatingDescriptor) GetTag() *DescriptorTag

type UnallocatedSpaceDescriptor

type UnallocatedSpaceDescriptor struct {
	Tag                            DescriptorTag
	VolumeDescriptorSequenceNumber uint32
	NumberOfAllocationDescriptors  uint32
	AllocationDescriptors          []Extent
}

UnallocatedSpaceDescriptor shall be recorded, even if there is no free volume space. The first 32768 bytes of the Volume space shall not be used for the recording of ECMA 167 structures. This area shall not be referenced by the Unallocated Space Descriptor or any other ECMA 167 descriptor.

func (*UnallocatedSpaceDescriptor) GetIdentifier

func (d *UnallocatedSpaceDescriptor) GetIdentifier() int

func (*UnallocatedSpaceDescriptor) GetTag

type VolumeDescriptorPointer

type VolumeDescriptorPointer struct {
	Tag DescriptorTag
	// This field shall specify the Volume Descriptor Sequence Number for this descriptor.
	VolumeDescriptorSequenceNumber uint32
	// This field shall specify the next extent in the Volume Descriptor Sequence. If the extent's length is 0, no such
	//extent is specified.
	NextVolumeDescriptorSequenceExtent Extent
}

func (*VolumeDescriptorPointer) GetIdentifier

func (d *VolumeDescriptorPointer) GetIdentifier() int

func (*VolumeDescriptorPointer) GetTag

Jump to

Keyboard shortcuts

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