Types and interfaces from design §2.1: FS, File, FileInfo, Caps, VolumeID, RenameMode, CreateMode, PathOps (posix and native), Location.Same, the optional Trasher/BirthTimer/Execer interfaces and ReadOnly(fs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package vfs
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"io/fs"
|
|
)
|
|
|
|
// Sentinel errors, checked with errors.Is. Implementations map their native
|
|
// errors (errno, SFTP status codes) onto these, so the UI and transfer never
|
|
// see *sftp.StatusError.
|
|
//
|
|
// ErrNotExist, ErrExist and ErrPermission are the io/fs sentinels and
|
|
// ErrUnsupported is errors.ErrUnsupported, so *os.PathError values from the
|
|
// local disk already match without wrapping. ErrCancelled is context.Canceled.
|
|
var (
|
|
ErrNotExist = fs.ErrNotExist
|
|
ErrExist = fs.ErrExist
|
|
ErrPermission = fs.ErrPermission
|
|
ErrUnsupported = errors.ErrUnsupported
|
|
ErrCancelled = context.Canceled
|
|
|
|
// ErrReadOnly: the FS (or the volume behind it) does not allow writes.
|
|
ErrReadOnly = errors.New("read-only file system")
|
|
// ErrConnLost: the connection died; the operation may be retried after
|
|
// a reconnect.
|
|
ErrConnLost = errors.New("connection lost")
|
|
)
|
|
|
|
// SkipDir and SkipAll are returned by a WalkFunc to skip a directory's
|
|
// contents or stop the walk without an error.
|
|
var (
|
|
SkipDir = fs.SkipDir
|
|
SkipAll = fs.SkipAll
|
|
)
|