filehandler

package
v0.0.0-...-7e7f35b Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertRarToCbz

func ConvertRarToCbz(src string)

func FileExists

func FileExists(path string) bool

func FileMustExist

func FileMustExist(path, name string)

func FolderExists

func FolderExists(path string) bool

func FolderMustExist

func FolderMustExist(path, name string)

func GetFileFolder

func GetFileFolder(filePath string) string

func GetFoldersInCurrentFolder

func GetFoldersInCurrentFolder(path string) []string

func JoinPath

func JoinPath(elements ...string) string

func MustCreateFolderIfNotExists

func MustCreateFolderIfNotExists(path string)

func MustGetAllFilesWithExtInASpecificFolder

func MustGetAllFilesWithExtInASpecificFolder(dir, ext string) []string

func MustGetAllFilesWithExtsInASpecificFolderAndSubFolders

func MustGetAllFilesWithExtsInASpecificFolderAndSubFolders(dir string, exts ...string) []string

based on https://stackoverflow.com/a/67629473

func MustGetFileSize

func MustGetFileSize(path string) float64

func MustRename

func MustRename(src, dest string)

func ReadInBinaryFileContents

func ReadInBinaryFileContents(path string) []byte

func ReadInFileContents

func ReadInFileContents(path string) string

func Rezip

func Rezip(src, dest string) error

Rezip is based on https://stackoverflow.com/a/63233911

func Unzip

func Unzip(src, dest string) error

Unzip is based on https://stackoverflow.com/a/24792688

func UnzipRunOperationAndRezip

func UnzipRunOperationAndRezip(src, dest string, operation func())

UnzipRunOperationAndRezip starts by deleting the destination directory if it exists, then it goes ahead an unzips the contents into the destination directory once that is done it runs the operation func on the destination folder lastly it rezips the folder back to compress.zip

func UnzipSource

func UnzipSource(source, destination string) error

func WriteBinaryFileContents

func WriteBinaryFileContents(path string, content []byte)

func WriteFileContents

func WriteFileContents(path, content string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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