cmmt

package
v1.11.13 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package cmmt discovers and stores any found zip comments.

Index

Constants

View Source
const (
	SuffixName = `_zipcomment.txt` // SuffixName is the suffix string to append to the file name.
	SceneOrg   = `scene.org`       // SceneOrg is a search term used to ignore unwanted zipcomments.

)

Variables

View Source
var (
	ErrID       = errors.New("zipfile id cannot be zero")
	ErrPath     = errors.New("path directory cannot be empty")
	ErrPointer  = errors.New("pointer value cannot be nil")
	ErrUUID     = errors.New("uuid zipfile id cannot be empty")
	ErrZipIsDir = errors.New("path to the named zipfile comment is a directory")
)

Functions

This section is empty.

Types

type Zipfile

type Zipfile struct {
	ID        uint           // ID is the database auto increment ID.
	UUID      string         // Universal Unique ID.
	Name      string         // Name of the file.
	Ext       string         // Ext is the extension of the filename.
	Size      int            // Size of the size in bytes.
	Magic     sql.NullString // Magic or MIME type of the file.
	ASCII     bool           // ASCII, plaintext encoded zip comment.
	CP437     bool           // CP437, MS-DOS text encoded zip comment.
	Overwrite bool           // Overwrite a preexisting zip comment.
}

Zipfile structure for files archived or compressed with a ZIP format.

func (*Zipfile) Exist added in v1.11.0

func (z *Zipfile) Exist(path string) (bool, error)

Exists returns true when the UUID comment file exists in the path.

func (*Zipfile) Format added in v1.11.0

func (z *Zipfile) Format(cmmt *string) (buffer.Buffer, error)

func (*Zipfile) Save

func (z *Zipfile) Save(w io.Writer, path string) (string, error)

Save an embedded zipfile, text comment to the path.

Jump to

Keyboard shortcuts

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