files

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2016 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Cross-platform file utils.

Index

Constants

View Source
const (
	FILE_RW = os.FileMode(0666)
	FILE_W  = os.FileMode(0222)
	FILE_R  = os.FileMode(0444)
)

We don't concern ourselves with executable files here.

Variables

This section is empty.

Functions

func FileExists

func FileExists(fileName string) bool

Does the file with the given name exist?

func IsRegular

func IsRegular(fileName string) bool

func IsWritable

func IsWritable(fm os.FileMode) bool

func ReadFile

func ReadFile(fileName string) ([]byte, error)

func Rename

func Rename(oldname, newname string) error

Rename for linux and macs etc. Don't really care about the rest.

func WriteAndBackup

func WriteAndBackup(fileName string, data []byte) error

func WriteFile

func WriteFile(fileName string, data []byte, perm os.FileMode) error

WriteFile.

func WriteFileRW

func WriteFileRW(fileName string, data []byte) error

Write a file that has both read and write flags set.

func WriteFileReadOnly

func WriteFileReadOnly(fileName string, data []byte) error

Write file with the read-only flag set.

func WriteFileWriteOnly

func WriteFileWriteOnly(fileName string, data []byte) error

Write file with the write-only flag set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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