fileio

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: May 24, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package fileio handles the interaction with files.

Index

Constants

This section is empty.

Variables

View Source
var ErrPathIsADir = errors.New("path is a directory")

ErrPathIsADir represents an error.

Functions

func CreateDirectory added in v0.9.0

func CreateDirectory(path string) error

CreateDirectory creates the given directory.

func IsDirExists added in v0.9.0

func IsDirExists(dirPath string) (bool, error)

IsDirExists checks whether the given directory exists.

func IsFileExists added in v0.7.0

func IsFileExists(filePath string) (bool, error)

IsFileExists checks whether the given file exists.

Types

type File

type File struct {
	Path       string
	Permission os.FileMode
}

File struct represent a file

func (*File) Read

func (p *File) Read() ([]byte, error)

Read method reads the file.

func (*File) Write

func (p *File) Write(data []byte) error

Write method writes data to the file.

Jump to

Keyboard shortcuts

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