fsys

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package fsys is the small filesystem interface hopsesh reads sessions through, so the same code enumerates sessions on this machine (os) and on a remote one (SFTP).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Appender added in v0.2.0

type Appender interface {
	AppendKeepTime(name string, data []byte) error
}

Appender is a filesystem that can append a record to a file without changing its modification time (used only to mark a copy left behind; never on a live session).

type FS

type FS interface {
	ReadDir(dir string) ([]os.FileInfo, error)
	Stat(name string) (os.FileInfo, error)
	Open(name string) (File, error)
	// Join joins path elements using this filesystem's separator rules.
	Join(elem ...string) string
	// Base returns the last element of a path.
	Base(p string) string
}

FS is a read-mostly filesystem.

type File

type File interface {
	io.Reader
	io.ReaderAt
	io.Closer
	Stat() (os.FileInfo, error)
}

File is an open file that supports random access.

type Local

type Local struct{}

Local is the machine's own filesystem.

func (Local) AppendKeepTime added in v0.2.0

func (Local) AppendKeepTime(name string, data []byte) error

AppendKeepTime appends data, starting on a new line, and restores the file's times.

func (Local) Base

func (Local) Base(p string) string

func (Local) Join

func (Local) Join(elem ...string) string

func (Local) Open

func (Local) Open(name string) (File, error)

func (Local) ReadDir

func (Local) ReadDir(dir string) ([]os.FileInfo, error)

func (Local) Stat

func (Local) Stat(name string) (os.FileInfo, error)

type Slash

type Slash struct{}

Slash joins with forward slashes; remote SFTP paths always use them, including on Windows servers (where absolute paths look like /C:/Users/...).

func (Slash) Base

func (Slash) Base(p string) string

func (Slash) Join

func (Slash) Join(elem ...string) string

Jump to

Keyboard shortcuts

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