Documentation ¶
Index ¶
- Constants
- func CopyFile(srcPath, dstPath string) error
- func Download(filepath string, url string) (err error)
- func ExtName(fpath string) string
- func IsDir(path string) bool
- func IsFile(path string) bool
- func MkDirs(perm os.FileMode, dirPaths ...string) error
- func MkSubDirs(perm os.FileMode, parentDir string, subDirs ...string) error
- func MustReadFile(filePath string) []byte
- func OpenFile(filepath string, flag int, perm os.FileMode) (*os.File, error)
- func RemoveDir(dir string) error
- func Workdir() string
- func WriteOSFile(f *os.File, data any) (n int, err error)
Constants ¶
View Source
const ( FsCWAFlags = os.O_CREATE | os.O_WRONLY | os.O_APPEND // create, append write-only FsCWTFlags = os.O_CREATE | os.O_WRONLY | os.O_TRUNC // create, override write-only FsCWFlags = os.O_CREATE | os.O_WRONLY // create, write-only FsRFlags = os.O_RDONLY // read-only )
some commonly flag consts for open file
Variables ¶
This section is empty.
Functions ¶
func MustReadFile ¶
MustReadFile read file contents, will panic on error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.