ext2

package
v0.0.0-...-7a35909 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2016 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package ext2 implements read-only access to EXT2 file systems.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dir

type Dir struct {
	Name  string
	Inode uint32
}

A Dir represents a directory entry.

type FS

type FS struct {
	BlockSize int
	NumBlock  int64
	// contains filtered or unexported fields
}

An FS represents a file system.

func Init

func Init(r io.ReaderAt) (*FS, error)

Init returns an FS reading from the file system stored in r.

func Open

func Open(name string) (*FS, error)

Open opens the file system in the named file.

If the name contains an @ sign, it is taken to be of the form file@offset, where offset is a decimal, hexadecimal, or octal number according to its prefix, and the file system is assumed to start at the given offset in the file instead of at the beginning of the file.

func (*FS) File

func (fs *FS) File(inode uint32) (*File, error)

File returns the file with the given inode number.

func (*FS) Root

func (fs *FS) Root() (*File, error)

Root returns the root directory of the file system.

type File

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

A File represents a file or directory in a file system.

func (*File) IsDir

func (f *File) IsDir() bool

func (*File) Lookup

func (f *File) Lookup(name string) (*File, error)

Lookup looks up the name in the directory f, returning the corresponding child file.

func (*File) ModTime

func (f *File) ModTime() time.Time

ModTime returns the file's modification time.

func (*File) Mode

func (f *File) Mode() os.FileMode

Mode returns the file's mode.

func (*File) Open

func (f *File) Open() (io.Reader, error)

Open returns an io.Reader for the file.

func (*File) ReadAt

func (f *File) ReadAt(buf []byte, off int64) (n int, err error)

ReadAt implements the io.ReaderAt interface.

func (*File) ReadDir

func (f *File) ReadDir() ([]Dir, error)

ReadDir returns all the directory entries in f.

func (f *File) ReadLink() (string, error)

ReadLink returns the symbolic link content of f.

func (*File) Size

func (f *File) Size() int64

Size returns the file's size in bytes.

Jump to

Keyboard shortcuts

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