systemfs

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: MIT Imports: 10 Imported by: 1

Documentation

Overview

Package systemfs provides an io/fs implementation that uses the osfs as default, while a ntfs for every partition as a fallback on Windows, on UNIX the behavior is the same as osfs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() (fs.FS, error)

New creates a new system FS.

func NewWithSize added in v0.15.1

func NewWithSize(pageSize int64, cacheSize int) (fs.FS, error)

NewWithSize creates a new system FS.

Types

type FS

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

FS implements a read-only file system for all operating systems.

func (*FS) NTFSOpen

func (systemfs *FS) NTFSOpen(name string) (fs.File, func() error, error)

func (*FS) Open

func (systemfs *FS) Open(name string) (item fs.File, err error)

Open opens a file for reading.

func (*FS) Stat

func (systemfs *FS) Stat(name string) (info fs.FileInfo, err error)

Stat returns an fs.FileInfo object that describes a file.

type Item

type Item struct {
	fs.File
	// contains filtered or unexported fields
}

Item describes files and directories in the file system.

func (*Item) Close

func (i *Item) Close() error

Close closes the file freeing the resource. Usually additional IO operations fail after closing.

type Root

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

Root is a pseudo root directory for windows partitions.

func (*Root) Close

func (*Root) Close() error

Close does not do anything for window pseudo roots.

func (*Root) IsDir

func (*Root) IsDir() bool

IsDir returns true for window pseudo roots.

func (*Root) ModTime

func (*Root) ModTime() time.Time

ModTime returns the zero time (0001-01-01 00:00) for window pseudo roots.

func (*Root) Mode

func (*Root) Mode() fs.FileMode

Mode returns fs.ModeDir for window pseudo roots.

func (*Root) Name

func (*Root) Name() (name string)

Name always returns / for window pseudo roots.

func (*Root) Read

func (r *Root) Read([]byte) (int, error)

func (*Root) ReadDir

func (r *Root) ReadDir(n int) (entries []fs.DirEntry, err error)

func (*Root) Size

func (*Root) Size() int64

Size returns 0 for window pseudo roots.

func (*Root) Stat

func (r *Root) Stat() (fs.FileInfo, error)

Stat returns the windows pseudo roots itself as fs.FileMode.

func (*Root) Sys

func (*Root) Sys() interface{}

Sys returns nil for window pseudo roots.

Jump to

Keyboard shortcuts

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