file

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: GPL-3.0 Imports: 4 Imported by: 13

README

File

A simple library to work with files and folders.

Documentation

Index

Constants

View Source
const (
	ErrObjectIsNotFile   = "object is not a file"
	ErrObjectIsNotFolder = "object is not a folder"
)

Variables

This section is empty.

Functions

func CreateFolderSafely

func CreateFolderSafely(path string, permissions os.FileMode) (err error)

CreateFolderSafely tries to create a folder ignoring an error if the folder already exists.

func Exists

func Exists(path string) (exists bool, err error)

Exists tries to get access to an object at the specified path – it may be a file or a folder.

func FileExists

func FileExists(filePath string) (ok bool, err error)

FileExists tells if a file exists.

func FolderExists

func FolderExists(folderPath string) (ok bool, err error)

FolderExists tells if a folder exists.

func GetFileContents added in v0.5.0

func GetFileContents(filePath string) (contents []byte, err error)

GetFileContents gets file's contents.

Types

This section is empty.

Jump to

Keyboard shortcuts

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