Help us shape the future of Go! Take the 2026 Go Developer Survey

fsys

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package fsys provides a real-OS filesystem implementation of the FS interface defined in core/interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultFS

func DefaultFS() interfaces.FS

DefaultFS returns the default filesystem implementation.

Types

type FS

type FS = interfaces.FS

FS is a type alias for the core FS interface, allowing callers to reference fsys.FS without importing core/interfaces directly.

type OSFS

type OSFS struct{}

OSFS is the default filesystem implementation that delegates to the os package. It is safe for concurrent use by multiple goroutines.

func NewOSFS

func NewOSFS() *OSFS

NewOSFS creates a new OSFS instance.

func (*OSFS) MkdirAll

func (f *OSFS) MkdirAll(
	path string,
	perm fs.FileMode,
) error

MkdirAll creates a directory tree, delegating to os.MkdirAll.

func (*OSFS) ReadDir

func (f *OSFS) ReadDir(name string) ([]fs.DirEntry, error)

ReadDir reads a directory's entries, delegating to os.ReadDir.

func (*OSFS) ReadFile

func (f *OSFS) ReadFile(name string) ([]byte, error)

ReadFile reads an entire file, delegating to os.ReadFile.

func (*OSFS) RemoveAll

func (f *OSFS) RemoveAll(path string) error

RemoveAll removes a path and its children, delegating to os.RemoveAll.

func (*OSFS) Rename

func (f *OSFS) Rename(
	oldpath, newpath string,
) error

Rename renames a file or directory, delegating to os.Rename.

func (*OSFS) Stat

func (f *OSFS) Stat(name string) (fs.FileInfo, error)

Stat returns file information, delegating to os.Stat.

func (*OSFS) WriteFile

func (f *OSFS) WriteFile(name string, data []byte, perm fs.FileMode) error

WriteFile writes data to a file, delegating to os.WriteFile.

Jump to

Keyboard shortcuts

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