io

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package io contains methods that can be useful for manipulating files/folders

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackupFilesWithExt

func BackupFilesWithExt(dir string, extensions []string) error

BackupFilesWithExt take an inline (same folder) copy (adding suffix of .bak to the original names) of the files with the extensions It does not delete the original files

func DeleteFileWithExt

func DeleteFileWithExt(dir string, extensions []string) error

DeleteFileWithExt will delete all the files from the dir with extensions in the list extensions must be in the format .<ext> for matching Exact matches only, and the file end extension will be used to compare For example if the file found in dir is named file-name.txt.bak .bak is the determined extension for comparison

func RestoreAllBakFiles

func RestoreAllBakFiles(dir string) error

RestoreAllBakFiles copies all the bak files into their respective original (dropping .bak extension) files and deletes the .bak files

func SafeClose added in v0.1.0

func SafeClose(c io.Closer)

SafeClose will close the closer safely

func SafeClosePrint added in v0.1.0

func SafeClosePrint(c io.Closer)

SafeClosePrint will close the closer safely and print the error

Types

This section is empty.

Jump to

Keyboard shortcuts

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