fileutils

package module
v0.0.0-...-0b6e87f Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2014 License: BSD-2-Clause Imports: 3 Imported by: 2

README

#Description

fileutils is a set of useful file utilities for Go.

#Installation

go get github.com/gyepisam/fileutils

Documentation

See go files

Author

Gyepi Sam

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtomicWrite

func AtomicWrite(path string, writer func(*os.File) error) (err error)

AtomicWrite allows a function to write atomically to a named file. It first opens a file handle to a temporary file in the same directory as the target file and invokes the function, with the file handle as a parameter. If the function returns nil, AtomicWrite renames the temporary file over the target file. Any necessary directories to the target file are created.

func DirExists

func DirExists(name string) (bool, error)

DirExists is an alias for IsDir.

func Exists

func Exists(name string) (bool, error)

Exists returns a boolean denoting whether the name exists in the file system. A non-existent entity returns false.

func FileExists

func FileExists(name string) (bool, error)

FileExists is an alias for IsFile.

func IsDir

func IsDir(name string) (bool, error)

IsDir returns a boolean denoting whether name represents a directory. A non-existent directory returns false.

func IsFile

func IsFile(name string) (bool, error)

IsFile returns a boolean denoting whether name represents a file. A non-existent file returns false.

Types

This section is empty.

Jump to

Keyboard shortcuts

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