fileutil

package
v0.0.0-...-59c870d Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2015 License: GPL-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDirectory

func CopyDirectory(fromDir, toDir string, filter FileFilter) error

func CopyFile

func CopyFile(from, to string) error

func FindDirectoryTemplates

func FindDirectoryTemplates(base, branch string) ([]string, error)

Traverses the file tree and returns directory templates along the way, until it either hits defined base dir or a final directory template

func IsSymLink(filePath string) (bool, error)

func ReadMetaData

func ReadMetaData(filePath string, removeMeta bool) ([]byte, []byte, error)

Read meta data from file (if any) If removeMeta is true, meta data is also removed from the file Returns meta data and the rest of the file content

Types

type FileFilter

type FileFilter struct {
	HiddenDirs     bool
	HiddenFiles    bool
	TemporaryFiles bool
	FollowSymLinks bool
	Blacklist      []string
	Whitelist      []string
}

func (FileFilter) IsAllowed

func (ff FileFilter) IsAllowed(filePath string, isDir bool) (bool, error)

Jump to

Keyboard shortcuts

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