file

package
v0.0.0-...-66c0c6b Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyNFilesUnderDir

func CopyNFilesUnderDir(outFilename, inDir string) error

func CopyNFilesUnderDirBySplice

func CopyNFilesUnderDirBySplice(outFilename, inDir string) error

func FastZeroFile

func FastZeroFile(w TruncateWriter, fileSize int64) (err error)

FastZeroFile Create an empty big file quickly.

func FastZeroFileByTruncate

func FastZeroFileByTruncate(w TruncateWriter, fileSize int64) (err error)

Types

type Piece

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

func Cutting

func Cutting(pathToFile string, maxSize PieceSize) ([]*Piece, error)

func (*Piece) GetFilename

func (p *Piece) GetFilename() string

func (*Piece) GetPath

func (p *Piece) GetPath() string

func (*Piece) GetSeekInfo

func (p *Piece) GetSeekInfo() (int64, int64, int64)

func (*Piece) GetShardingInfo

func (p *Piece) GetShardingInfo() (int, int)

func (*Piece) HasBeenCut

func (p *Piece) HasBeenCut() bool

type PieceSize

type PieceSize = int64
const (
	Byte PieceSize = 1
	KB   PieceSize = 1024 * Byte
	MB   PieceSize = 1024 * KB
)

type TruncateWriter

type TruncateWriter interface {
	io.WriteSeeker
	Truncate(size int64) error
}

Jump to

Keyboard shortcuts

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