Documentation ¶
Overview ¶
Package squashfs implements writing SquashFS file system images using zlib compression for data blocks (inodes and directory entries are written uncompressed for simplicity).
Note that SquashFS requires directory entries to be sorted, i.e. files and directories need to be added in the correct order.
This package intentionally only implements a subset of SquashFS. Notably, block devices, character devices, FIFOs, sockets and xattrs are not supported.
Index ¶
- Constants
- type Directory
- func (d *Directory) Directory(name string, modTime time.Time) *Directory
- func (d *Directory) File(name string, modTime time.Time, mode uint16, xattrs []Xattr) (io.WriteCloser, error)
- func (d *Directory) Flush() error
- func (d *Directory) Symlink(oldname, newname string, modTime time.Time, mode os.FileMode) error
- type FileInfo
- type FileNotFoundError
- type Inode
- type Reader
- func (r *Reader) FileReader(inode Inode) (*io.SectionReader, error)
- func (r *Reader) LlookupPath(path string) (Inode, error)
- func (r *Reader) LookupPath(path string) (Inode, error)
- func (r *Reader) ReadLink(i Inode) (string, error)
- func (r *Reader) ReadXattrs(inode Inode) ([]Xattr, error)
- func (r *Reader) Readdir(dirInode Inode) ([]os.FileInfo, error)
- func (r *Reader) ReaddirNoStat(dirInode Inode) ([]os.FileInfo, error)
- func (r *Reader) RootInode() Inode
- func (r *Reader) Stat(name string, i Inode) (os.FileInfo, error)
- type Writer
- type Xattr
Constants ¶
const ( XattrTypeUser = iota XattrTypeTrusted XattrTypeSecurity )
xattr types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
Directory represents a SquashFS directory.
func (*Directory) Directory ¶
Directory creates a new directory with the specified name and modTime.
func (*Directory) File ¶
func (d *Directory) File(name string, modTime time.Time, mode uint16, xattrs []Xattr) (io.WriteCloser, error)
File creates a file with the specified name, modTime and mode. The returned io.WriterCloser must be closed after writing the file.
type FileNotFoundError ¶
type FileNotFoundError struct {
// contains filtered or unexported fields
}
func (*FileNotFoundError) Error ¶
func (e *FileNotFoundError) Error() string
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func (*Reader) FileReader ¶
func (r *Reader) FileReader(inode Inode) (*io.SectionReader, error)
func (*Reader) LlookupPath ¶
LlookupPath is like LookupPath, but does not follow symbolic links, i.e. will instead return the inode of the link itself.
func (*Reader) ReaddirNoStat ¶
Like Readdir, but does not call Stat on each file. The returned FileInfo structs will still have a filled in Name, partly filled in Mode, and filled in Inode.
type Writer ¶
type Writer struct { // Root represents the file system root. Like all directories, Flush must be // called precisely once. Root *Directory // contains filtered or unexported fields }