file

package
v0.0.0-...-6c31ca2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanWrite

func CanWrite(filepath string) (bool, error)

func CheckDuplicate

func CheckDuplicate(path string, info os.FileInfo, err error) error

func CheckIfExists

func CheckIfExists(fileName string) bool

func Compress

func Compress(inFile string, ext string)

func Contains

func Contains(s []string, str string) bool

func ConvertToString

func ConvertToString(inFile string) string

func Copy

func Copy(fileName string)

func CurrentPath

func CurrentPath(fileName string) string

func Decompress

func Decompress(inFile string)

func DetectContentType

func DetectContentType(fileName string) string

Verifique o tipo de conteúdo do arquivo específicado

func File2lines

func File2lines(filePath string) ([]string, error)

func FindPositionLineText

func FindPositionLineText(path string, text string) int

func GetHashMD4

func GetHashMD4(fileName string)

func GetHashMD5

func GetHashMD5(fileName string)

func GetHashSHA

func GetHashSHA(fileName string)

func GetInfo

func GetInfo(fileName string)

func GetNumberLines

func GetNumberLines(path string) int

func GetPermission

func GetPermission(fileName string)

func GetStringLineByIndex

func GetStringLineByIndex(path string, index int) string

func GetStringLinesByFile

func GetStringLinesByFile(path string) []string

func InsertStringToFile

func InsertStringToFile(path, str string, index int) error

Insert sting to n-th line of file. If you want to insert a line, append newline '\n' to the end of the string.

func LinesFromReader

func LinesFromReader(r io.Reader) ([]string, error)

func Move

func Move(directory string, ext string)

func New

func New(fileName string, destination string)

func NewScript

func NewScript(cmd, fileName, destination string) string

func NewTempFile

func NewTempFile(tempFileName string, envVariable string)

func ReadCSV

func ReadCSV(fileName string) []string

func ReadJSON

func ReadJSON(fileName string, key interface{}) interface{}

func ReadXML

func ReadXML(fileName string, key interface{}) interface{}

func RedirectLogFile

func RedirectLogFile(content string, nameFile string)

func RemoveBigFile

func RemoveBigFile(fileName string)

func RemoveFile

func RemoveFile(fileName string)

func RemoveFilesByExtension

func RemoveFilesByExtension(path string, ext string)

func ReplaceText

func ReplaceText(inFile string, oldWord string, newWord string)

func SaveCSV

func SaveCSV(fileName string, key [][]string)

func SaveJSON

func SaveJSON(fileName string, key interface{})

func SaveXML

func SaveXML(fileName string, key interface{})

func SetReadOnly

func SetReadOnly(filepath string) error

func SetWritable

func SetWritable(filepath string) error

func Split

func Split(fileName string)

func UploadToURL

func UploadToURL(uri string, fileName string)

func WhatsIsExtension

func WhatsIsExtension(fileName []string) []string

Types

type Config

type Config map[string]string

func ReadConfigTXT

func ReadConfigTXT(filename string) (Config, error)

Jump to

Keyboard shortcuts

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