osmisc

package
v0.0.0-...-bbc9ce3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(srcDir, dstDir string) error

CopyDir copies the src directory into the target directory, preserving file and directory modes.

func CopyFile

func CopyFile(src, dest string) error

CopyFile copies a file to a given destination.

func CreateFile

func CreateFile(path string, flags ...int) (*os.File, error)

CreateFile creates the file specified by the given path and all parent directories if they don't exist. If flags are provided, they will be passed to open() with os.O_CREATE.

func DirIsEmpty

func DirIsEmpty(dir string) (bool, error)

DirIsEmpty returns whether a given directory is empty. By convention, we say that a directory is empty if it does not exist.

func FileExists

func FileExists(name string) (bool, error)

FileExists returns whether a given file exists.

func FileIsOpen

func FileIsOpen(f *os.File) bool

FileIsOpen returns whether the given file is open or not.

func IsDir

func IsDir(path string) (bool, error)

IsDir determines whether a given path exists *and* is a directory. It will return false (with no error) if the path does not exist. It will return true if the path exists, even if the user doesn't have permission to enter and read files in the directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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