bf9395e022
CI / license-header (push) Has been skipped
CI / e2e-dry-run (push) Has been skipped
CI / fast-gate (push) Failing after 0s
Test PR Label Logic / test-pr-labels (push) Failing after 1s
Skill Format Check / check-format (push) Failing after 2s
CI / security (push) Failing after 5s
CI / unit-test (push) Has been skipped
CI / lint (push) Has been skipped
CI / script-test (push) Has been skipped
CI / deterministic-gate (push) Has been skipped
CI / coverage (push) Has been skipped
CI / results (push) Has been cancelled
CI / deadcode (push) Has been cancelled
CI / e2e-live (push) Has been cancelled
43 lines
1.8 KiB
Go
43 lines
1.8 KiB
Go
// Copyright (c) 2026 Lark Technologies Pte. Ltd.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package vfs
|
|
|
|
import (
|
|
"io/fs"
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
// OsFs delegates every method to the os standard library.
|
|
type OsFs struct{}
|
|
|
|
// Query
|
|
func (OsFs) Stat(name string) (fs.FileInfo, error) { return os.Stat(name) }
|
|
func (OsFs) Lstat(name string) (fs.FileInfo, error) { return os.Lstat(name) }
|
|
func (OsFs) Getwd() (string, error) { return os.Getwd() }
|
|
func (OsFs) UserHomeDir() (string, error) { return os.UserHomeDir() }
|
|
|
|
// Read/Write
|
|
func (OsFs) ReadFile(name string) ([]byte, error) { return os.ReadFile(name) }
|
|
func (OsFs) WriteFile(name string, data []byte, perm fs.FileMode) error {
|
|
return os.WriteFile(name, data, perm)
|
|
}
|
|
func (OsFs) Open(name string) (*os.File, error) { return os.Open(name) }
|
|
func (OsFs) OpenFile(name string, flag int, perm fs.FileMode) (*os.File, error) {
|
|
return os.OpenFile(name, flag, perm)
|
|
}
|
|
func (OsFs) CreateTemp(dir, pattern string) (*os.File, error) { return os.CreateTemp(dir, pattern) }
|
|
|
|
// Directory/File management
|
|
func (OsFs) MkdirAll(path string, perm fs.FileMode) error { return os.MkdirAll(path, perm) }
|
|
func (OsFs) MkdirTemp(dir, pattern string) (string, error) { return os.MkdirTemp(dir, pattern) }
|
|
func (OsFs) ReadDir(name string) ([]os.DirEntry, error) { return os.ReadDir(name) }
|
|
func (OsFs) Remove(name string) error { return os.Remove(name) }
|
|
func (OsFs) RemoveAll(path string) error { return os.RemoveAll(path) }
|
|
func (OsFs) Rename(oldpath, newpath string) error { return os.Rename(oldpath, newpath) }
|
|
|
|
// Path resolution
|
|
func (OsFs) EvalSymlinks(path string) (string, error) { return filepath.EvalSymlinks(path) }
|
|
func (OsFs) Executable() (string, error) { return os.Executable() }
|