holes

package
v0.0.0-...-ece74ff Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package holes finds and pretty-prints holes & data sections of a file. Used by TestFileHoleCopy in the gocryptfs test suite.

Index

Constants

View Source
const (
	SEEK_DATA = 3
	SEEK_HOLE = 4

	SegmentHole = SegmentType(100)
	SegmentData = SegmentType(101)
	SegmentEOF  = SegmentType(102)
)

Variables

This section is empty.

Functions

func Create

func Create(path string)

Create a test file at `path` with random holes

func PrettyPrint

func PrettyPrint(segments []Segment) (out string)

PrettyPrint pretty-prints the Segments.

func Verify

func Verify(fd int, segments []Segment) (err error)

Verify the gives `segments` using a full bytewise file scan

Types

type Segment

type Segment struct {
	Offset int64
	Type   SegmentType
}

func Find

func Find(fd int) (segments []Segment, err error)

Find examines the file passed via file descriptor and returns the found holes and data sections.

func (Segment) String

func (s Segment) String() string

type SegmentType

type SegmentType int

func (SegmentType) String

func (s SegmentType) String() string

type Whence

type Whence int

func (Whence) String

func (w Whence) String() string

Jump to

Keyboard shortcuts

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