os

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile added in v0.1.0

func CopyFile(dst io.Writer, filePath string) (int64, error)

func EnsureDir

func EnsureDir(dir string, empty bool) (bool, error)

EnsureDir checks if the specified directory exists, and optionally verifies if it is empty. If the directory does not exist, it attempts to create it with 0755 permissions.

func IsDirEmpty

func IsDirEmpty(path string) (bool, error)

IsDirEmpty returns true if the directory at path is empty, false otherwise. Returns an error if the path does not exist or is not a directory.

func ListFiles added in v0.1.0

func ListFiles(path string) ([]string, error)

ListFiles takes a path and returns a slice of file paths. If the path is a regular file, it returns []string{path}. If it's a directory, it returns all regular files in that directory (non-recursive).

Types

This section is empty.

Jump to

Keyboard shortcuts

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