imgs

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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DIRECTORY_ITER_TYPE_DIR = 1
View Source
const DIRECTORY_ITER_TYPE_DIR_SPECIAL = 2
View Source
const DIRECTORY_ITER_TYPE_FILE = 0
View Source
const DIRECTORY_ITER_TYPE_SPECIAL = 3
View Source
const FAT1216_BR_SIZE = 512
View Source
const FAT_DIR_ARCHIVE = 0x20
View Source
const FAT_DIR_DIRECTORY = 0x10
View Source
const FAT_DIR_HIDDEN = 0x02
View Source
const FAT_DIR_READ_ONLY = 0x01
View Source
const FAT_DIR_SYSTEM = 0x04
View Source
const FAT_DIR_VOLUME_ID = 0x08
View Source
const HEADER_SIZE = 512
View Source
const PTYPE_FAT16 = 0x04

Partition Types

View Source
const PTYPE_FAT16B = 0x06
View Source
const SEC_SIZE = 512
View Source
const TYPE_CD = 6
View Source
const TYPE_FAT12 = 2
View Source
const TYPE_FAT16 = 3
View Source
const TYPE_IFF = 5
View Source
const TYPE_ISO9660 = 7
View Source
const TYPE_LOCAL_FOLDER = 4
View Source
const TYPE_MBR = 1
View Source
const TYPE_UNK = 0

Variables

This section is empty.

Functions

func Detect

func Detect(file_name string) (int, error)

func FAT_GetFileName83

func FAT_GetFileName83(file_name string) ([]byte, error)

Aquesta funció comprova si un nom de fitxer compleix amb l'estàndard 8.3, i si ho fa torna el nom preparat per a una entrada.

Types

type Directory

type Directory interface {

	// Torna un iterador a la primera entrada en l'ordre intern
	Begin() (DirectoryIter, error)

	// Crea directory. Si ja existeix no el torna a crear.
	MakeDir(name string) (Directory, error)

	// Torna un un FileWriter. Si el fitxer no existeix intenta crear-lo.
	GetFileWriter(name string) (FileWriter, error)
}

type DirectoryIter

type DirectoryIter interface {

	// Torna cert si el nom proporcionat és compatible amb el nom que
	// busquem.
	CompareToName(name string) bool

	// Indica final de fitxer.
	End() bool

	// Torna un directori amb el contingut del directori
	// actual. Intentar cridar aquest mètodes en entrades que no són
	// directoris torna un error.
	GetDirectory() (Directory, error)

	// Torna un FileReader del fitxer actual. Intentar cridar a aquest
	// mètode quan no és un fitxer torna un error.
	GetFileReader() (FileReader, error)

	// Torna el nom de l'entrada.
	GetName() string

	// Imprimeix én el fitxer indicat la línea que s'ha de veure per
	// pantalla d'eixe fitxer quan s'executa el comandament ls
	List(file io.Writer) error

	// Avança a la següent entrada
	Next() error

	// Elimina el fitxer o directori. En cas dels fitxers especials dona
	// error. ATENCIÓ!!!! Si s'intenta esborrar un directori no
	// s'assegura que s'esborren els fitxers apuntats per aquest. És
	// responsabilitat de l'usuari esborrar abans tots els fitxers abans
	// d'esborrar el directori.
	Remove() error

	// Retorna el tipus
	Type() int
}

type FileReader

type FileReader interface {

	// Llig en el buffer. Torna el nombre de bytes llegits. Quan aplega
	// al final torna 0 i io.EOF.
	Read(buf []byte) (int, error)

	// Tanca el fitxer.
	Close() error
}

type FileWriter

type FileWriter interface {

	// Escriu el buffer. Torna el nombre de bytes escrits .
	Write(buf []byte) (int, error)

	// Tanca el fitxer
	Close() error
}

type FindPathResult

type FindPathResult struct {
	IsDir  bool
	Dir    Directory
	FileIt DirectoryIter
}

func FindPath

func FindPath(

	dir Directory,
	path []string,
	path_is_dir bool,

) (FindPathResult, error)

Busca el path en el directori especificat. Tornant un punter al directori si ho és o a l'iterador del fitxer si és un fitxer. NOTA!!! Quan és un directori FileIt conté l'iterador que apunta al directori, sempre i quan no siga l'arrel

type Image

type Image interface {

	// Imprimeix la informació de la imatge en el fitxer especificat la
	// informació de la imatge. Cada línia s'imprimeix amb el prefix
	// indicat.
	PrintInfo(file io.Writer, prefix string) error

	// Torna el directori arrel del dispositiu.
	GetRootDirectory() (Directory, error)
}

func NewImage

func NewImage(file_name string) (Image, error)

Retorna la Imatge associada al fitxer expecificat. Si tot va bé error és nil.

Jump to

Keyboard shortcuts

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