fileutils

package
v0.0.0-...-acf58c8 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Overview

package fileutils contains all the helper the application needed in order to process file and directory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExists

func FileExists(filename string) bool

FileExists checks if a file exists and is not a directory before we try using it to prevent further errors.

func IsDirectory

func IsDirectory(path string) (bool, error)

IsDirectory checks whether path is a directory

func ListFiles

func ListFiles(dirpath string) ([]os.FileInfo, error)

ListFiles checks a directory and gets all the files and dir from it it also sorts the directory content

func LoadFile

func LoadFile(filepath string) ([]byte, error)

LoadFile helper, reads a file from the filepath returns its content and error if it doesn't exists.

func LookupFile

func LookupFile(dirname, contains string) (string, error)

LookupFile in a directory, if it exists, returns the full path to the file if it doesn't returns error takes the directory of the file, and the string containing parts of the file (or the whole file name)

func PathExists

func PathExists(path string) (bool, error)

PathExists checks if a 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