ddcio

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

ddcio include helper code for io operations common to ddc

ddcio include helper code for io operations common to ddc

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(src, dst string) error

CopyDir recursively copies a source directory to a destination. It does not copy file attributes, but does maintain directory structure. If the destination directory does not exist, CopyDir creates it. If a file with the same name exists at the destination, CopyDir overwrites it.

func CopyFile

func CopyFile(srcPath, dstPath string) error

func DeleteDirContents

func DeleteDirContents(dir string) error

func EnsureClose

func EnsureClose(fileName string, f func() error)

EnsureClose logs a failure when the close does not succeed this should not be used with "just in case closes" and should indeed signal an error

func GetFilesInDir

func GetFilesInDir(dir string) ([]os.DirEntry, error)

GetFilesInDir retrieves a list of directory entries for the given directory. It returns a slice of os.DirEntry representing the files and subdirectories in the directory. An error is returned if there is a problem reading the directory.

func GzipFile

func GzipFile(src, dst string) error

func Shell

func Shell(writer io.Writer, commandLine string) error

Shell executes a shell command with shell expansion and appends its output to the provided io.Writer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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