Documentation ¶
Overview ¶
Package os provides an io.FS that is implemented using the os package.
Index ¶
- func WithFlags(flags int) jsfs.OFOption
- type FS
- func (f *FS) Glob(pattern string) (matches []string, err error)
- func (f *FS) Mkdir(path string, perm fs.FileMode) error
- func (f *FS) MkdirAll(path string, perm fs.FileMode) error
- func (f *FS) Open(name string) (fs.File, error)
- func (f *FS) OpenFile(name string, perms fs.FileMode, options ...jsfs.OFOption) (fs.File, error)
- func (f *FS) ReadDir(name string) ([]fs.DirEntry, error)
- func (f *FS) ReadFile(name string) ([]byte, error)
- func (f *FS) Remove(name string) error
- func (f *FS) RemoveAll(path string) error
- func (f *FS) Stat(name string) (fs.FileInfo, error)
- func (f *FS) Sub(dir string) (fs.FS, error)
- func (f *FS) WriteFile(name string, content []byte, perm fs.FileMode) error
- type File
- func (f *File) Close() error
- func (f *File) OSFile() *os.File
- func (f *File) Read(b []byte) (n int, err error)
- func (f *File) ReadDir(n int) ([]fs.DirEntry, error)
- func (f *File) Seek(offset int64, whence int) (ret int64, err error)
- func (f *File) Stat() (fs.FileInfo, error)
- func (f *File) Write(b []byte) (n int, err error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
FS is a filesystem tied to the os filesystem implementing:
- fs.ReadDirFS
- fs.StatFS
- fs.ReadFileFS
- fs.GlobFS
using functions defined in the "os" and "filepath" packages. In addition this supports:
- gfs.Writer
- gfs.MkdirAllFS
- gfs.Remove
Where "gfs" is github.com/gopherfs/fs .
func (*FS) OpenFile ¶
OpenFile opens a file with the set flags and fs.FileMode. If you want to use the fs.File to write, you need to type assert if to *os.File. If Opening a file for
Click to show internal directories.
Click to hide internal directories.