dir

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyAll

func CopyAll(src string, dst string) error

CopyAll recursively copies the contents of the src directory into the dst directory.

It preserves file and directory permissions. Existing files or directories in the destination with the same name will be overwritten. Symbolic links and special files are not handled.

Parameters:

src - Path to the source directory.
dst - Path to the destination directory.

Returns an error if any operation fails.

Example usage:

err := dir.CopyAll("source", "destination")
if err != nil {
    log.Fatal(err)
}

func Exists

func Exists(path string) bool

Exists reports whether the specified path exists and is a directory.

It returns true if the path exists and is a directory, and false otherwise. This function does not follow symlinks; it checks the path as provided.

Example usage:

if dir.Exists("/tmp/mydir") {
    // Directory exists
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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