udf

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package udf writes UDF 2.50 file system images, a Blu-ray disc's: read-only, its files' entries and directories in a metadata partition (with its mirror), their contents in the physical partition laid out in an order the caller chooses, so that one file (a 3D film's SSIF) can be made of pieces of others, interleaved.

The layout is tsMuxeR's: the volume recognition sequence at sector 16, the volume descriptors at 32 (their reserve copy after the partition), the integrity descriptor at 64, anchors at 256 and at the last sector, the partition from 288 (its metadata file's entry first, the metadata from block 32, the files' contents, the metadata's mirror).

Index

Constants

View Source
const Sector = 2048

Sector is the image's sector and logical block size.

Variables

This section is empty.

Functions

func Write

func Write(w io.Writer, root *File, order []Piece, o Options) error

Write writes the image of root's tree to w: the pieces in order first, then every file not in them whole.

Types

type Entry added in v0.21.0

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

Entry is a file or directory of the image.

func (*Entry) IsDir added in v0.21.0

func (e *Entry) IsDir() bool

func (*Entry) Name added in v0.21.0

func (e *Entry) Name() string

Name is the entry's name; IsDir says it is a directory.

func (*Entry) ReadDir added in v0.21.0

func (e *Entry) ReadDir() ([]*Entry, error)

ReadDir is a directory's entries, in the directory's order, the parent and deleted ones left out.

func (*Entry) Reader added in v0.21.0

func (e *Entry) Reader() (*io.SectionReader, error)

Reader reads a file's bytes: its extents in order, holes as zeros.

func (*Entry) Size added in v0.21.0

func (e *Entry) Size() (int64, error)

Size is a file's length in bytes.

type File

type File struct {
	Name     string
	Dir      bool
	Children []*File
	// Size is a file's length; Content gives its bytes (from the start,
	// read once, in the order the image needs them: Write reads the
	// pieces of each file in order).
	Size    int64
	Content func() (io.Reader, error)
	// RealTime marks a stream file (UDF's real-time file, as Blu-ray's
	// m2ts and ssif are).
	RealTime bool
	// Parts, when set, make the file of pieces of other files (each in
	// Write's order), not of content of its own.
	Parts []Piece
	// contains filtered or unexported fields
}

File is a file or directory of the image.

type Image added in v0.21.0

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

Image is an image open for reading.

func Open added in v0.21.0

func Open(r io.ReaderAt, size int64) (*Image, error)

Open reads an image's structure from r: size bytes of it.

func (*Image) Root added in v0.21.0

func (img *Image) Root() *Entry

Root is the image's root directory.

type Options

type Options struct {
	// Label is the volume's name.
	Label string
	// Time is when it was recorded (the files' times too).
	Time time.Time
}

Options are the image's names and time.

type Piece

type Piece struct {
	F        *File
	Off, Len int64
}

Piece is a stretch of a file, [Off, Off+Len), in the image's data order.

Jump to

Keyboard shortcuts

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