fileutils

package
v0.0.0-...-8073689 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2015 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Overview

Package fileutils provides some file manipulation utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorId

type ErrorId int
const (
	ErrFileNotFound ErrorId = iota
	ErrOpeningSourceDir
	ErrCannotListSourceDir
	ErrUnexpected
	ErrCreatingTargetDir
	ErrOpeningSourceFile
	ErrOpeningTargetFile
	ErrCopyingFile
	ErrReadingSourceSymlink
	ErrWritingTargetSymlink
	ErrExternalSymlink
)

type Fileutils

type Fileutils interface {

	/*
		Copy copies a source file to a destination file. File contents are copied. File mode and permissions
		(as described in http://golang.org/pkg/os/#FileMode) are copied.

		Directories are copied, along with their contents.

		Copying a file or directory to itself succeeds but does not modify the filesystem.

		Symbolic links are not followed and are copied provided they refer to a file or directory being copied
		(otherwise a non-nil error is returned). The only exception is copying a symbolic link to itself, which
		always succeeds.
	*/
	Copy(destPath string, srcPath string) gerror.Gerror

	/*
		Tests the existence of a file or directory at a given path. Returns true if and only if the file or
		directory exists.
	*/
	Exists(path string) bool

	/*
		Filemode returns the os.FileMode of the file with the given path. If the file does not exist, returns
		an error with tag ErrFileNotFound.
	*/
	Filemode(path string) (os.FileMode, gerror.Gerror)
}

func New

func New() Fileutils

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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