utils

package
v0.0.0-...-8c41b54 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const OP_CAT = 3
View Source
const OP_COPY = 5
View Source
const OP_LIST = 2
View Source
const OP_MKDIR = 4
View Source
const OP_NONE = 0
View Source
const OP_REMOVE = 6
View Source
const OP_SHOW = 1
View Source
const VERSION = "1.2.0"

Variables

This section is empty.

Functions

func NumBytesToStr

func NumBytesToStr(num_bytes uint64) string

func PrintVersion

func PrintVersion()

func ReadBytes

func ReadBytes(

	f *os.File,
	f_begin int64,
	f_length int64,
	buf []byte,
	offset int64,

) error

Llig bytes d'un fitxer fent comprovacions

func Warning

func Warning(format string, args ...any)

func WriteBytes

func WriteBytes(

	f *os.File,
	f_begin int64,
	f_length int64,
	buf []byte,
	offset int64,

) error

Llig bytes d'un fitxer fent comprovacions

Types

type Args

type Args struct {

	// Diccionari amb els fitxers
	Files map[string]string

	// Operador i arguments
	Op     int
	OpArgs []string
	// contains filtered or unexported fields
}

func NewArgs

func NewArgs() (*Args, error)

func (*Args) GetPath

func (self *Args) GetPath(path string) (*Path, error)

Aquesta funció processa un 'string' representant un path a fitxer i torna un objecte PATH.

type Path

type Path struct {
	FileName string // Nom del fitxer on estem buscant
	Path     string
	Paths    []string // Camí al fitxer que busquem, si està buit vol
	// dir que busquem en l'arrel
	IsDir bool // Si l'últim caràcter és un / s'enten que es vol

}

type SubfileReader

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

func NewSubfileReader

func NewSubfileReader(

	file_name string,
	data_offset int64,
	data_length int64,

) (*SubfileReader, error)

func (*SubfileReader) Close

func (self *SubfileReader) Close() error

func (*SubfileReader) Read

func (self *SubfileReader) Read(buf []byte) (int, error)

Jump to

Keyboard shortcuts

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