fs

package
v3.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOutputFileInDir

func CreateOutputFileInDir(dir, basename string) (*os.File, error)

CreateOutputFileInDir creates a file for writing in the given dir with the given basename.

func DirValid

func DirValid(dir string) error

DirValid checks if the directory is valid: is absolute and exists.

func FindFilePathsInDir

func FindFilePathsInDir(dir, suffix string) ([]string, error)

FindFilePathsInDir finds files in the given dir that have basenames with the given suffix.

func FindOpenAndCreate

func FindOpenAndCreate(inputDir, outputDir, inputDirSuffix, outputDirSuffix string) ([]*os.File, *os.File, error)

FindOpenAndCreate takes an input and output directory, each with their own file suffix. Filepaths are located in the input directory, using the input suffix, an output file is created in the output directory, using the output suffix, and the two are then both returned.

func OpenFiles

func OpenFiles(paths []string) ([]*os.File, error)

OpenFiles opens the given files for reading.

func ReadCompressedFile

func ReadCompressedFile(filePath string) (string, error)

ReadCompressedFile takes the path of a compressed file, decompresses it, and returns the contents.

func RemoveAndCreateDir

func RemoveAndCreateDir(dir string) error

RemoveAndCreateDir creates the given directory, deleting it first if it already exists.

Types

type Error

type Error string

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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