Documentation ¶
Index ¶
- Constants
- Variables
- func Cat(path string) string
- func CopyContext(ctx context.Context, w io.Writer, r io.Reader) (err error)
- func CopyFile(srcPath, dstPath string, overwrite ...bool) (ok bool, err error)
- func ErrRw(err error) io.ReadWriteCloser
- func IORE(r io.Reader, err error) io.ReadCloser
- func IsEmptyDir(dir string) (empty bool)
- func IsExecutable(path string) bool
- func IsFile(path string) bool
- func Mkdir(dir string, perm os.FileMode) (ok bool, err error)
- func NocWriter(src io.Writer) io.WriteCloser
- func RandText(n int) (s string)
- func ReadFile(path string) (data []byte)
- func ReaderContextWrap(ctx context.Context, r io.Reader) io.Reader
- func Readlink(linkname string) (dir, name string, err error)
- func Symlink(ctx context.Context, oldname, newname string, overwrite ...bool) (err error)
- func WriteFileContext(ctx context.Context, src io.Reader, dstPath string, perm fs.FileMode) (err error)
- func WriteText[T ~string | ~[]byte](ctx context.Context, path string, data T, perm os.FileMode, overwrite ...bool) (err error)
- func WriterContextWrap(ctx context.Context, w io.Writer) io.Writer
Constants ¶
View Source
const ModeExecutable fs.FileMode = 0o111
Variables ¶
View Source
var B32 = base32.NewEncoding("abcdefghijklmnopqrstuvwxyz234567").WithPadding(base32.NoPadding)
Functions ¶
func ErrRw ¶
func ErrRw(err error) io.ReadWriteCloser
func Symlink ¶
Symlink 创建文件系统软链接
如果目标是软链接,删除 如果目标是目录,判断是否为空,为空则删除 如果目标是文件,如果overwrite == false报存在错,否则删除
func WriteFileContext ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.