fat16

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: 14 Imported by: 1

Documentation

Overview

Package fat16 provides an io/fs implementation of the FAT16 file systems.

Copyright (c) 2019-2020 Siemens AG Copyright (c) 2019-2021 Jonas Plum

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Author(s): Jonas Plum

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

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

FS implements a read-only file system for the FAT16 file system.

func New

func New(decoder fsio.ReadSeekerAt) (*FS, error)

New creates a new fat16 FS.

func (*FS) Open

func (m *FS) Open(name string) (f fs.File, err error)

Open opens a file for reading.

type Item

type Item struct {
	*io.SectionReader
	// contains filtered or unexported fields
}

Item describes files and directories in the FAT16 file system.

func NewItem

func NewItem(name string, fs *FS, directoryEntry *directoryEntry) *Item

NewItem creates a new fat16 Item.

func (*Item) Close

func (*Item) Close() error

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

func (*Item) IsDir

func (i *Item) IsDir() bool

IsDir returns if the item is a file.

func (*Item) ModTime

func (*Item) ModTime() time.Time

ModTime returns the modification time.

func (*Item) Mode

func (i *Item) Mode() fs.FileMode

Mode returns the fs.FileMode.

func (*Item) Name

func (i *Item) Name() string

Name returns the name of the file.

func (*Item) Read

func (i *Item) Read(p []byte) (n int, err error)

Read reads bytes into the passed buffer.

func (*Item) ReadAt

func (i *Item) ReadAt(p []byte, off int64) (n int, err error)

ReadAt reads bytes starting at off into passed buffer.

func (*Item) ReadDir

func (i *Item) ReadDir(n int) ([]fs.DirEntry, error)

func (*Item) Seek

func (i *Item) Seek(offset int64, whence int) (int64, error)

Seek move the current offset to the given position.

func (*Item) Size

func (i *Item) Size() int64

Size returns the item's size.

func (*Item) Stat

func (i *Item) Stat() (fs.FileInfo, error)

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

func (*Item) Sys

func (i *Item) Sys() interface{}

Sys returns underlying data source.

Jump to

Keyboard shortcuts

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