fs

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountChildren

func CountChildren(pf Pseudofile) int

CountChildren get amount of children

func FileExists

func FileExists(fn string) (bool, error)

FileExists check if file is real

func GetParentPath

func GetParentPath(cd string) string

GetParentPath dwisott

func IsDir

func IsDir(path string) (bool, error)

IsDir check if file is real

Types

type Directory

type Directory struct {
	Active     int
	ActiveFile Pseudofile
	Path       string
	Selected   map[string]bool
	Files      []Pseudofile
}

Directory holds representation of a directory

func NewDir

func NewDir(path string) (dir *Directory, err error)

NewDir get directory

func NewParentDir

func NewParentDir(cd string) (dir *Directory, err error)

NewParentDir get parent dir and select itself

func (*Directory) SelectFile

func (d *Directory) SelectFile(direction int) bool

SelectFile change active file

func (*Directory) SelectFileByName

func (d *Directory) SelectFileByName(name string)

SelectFileByName change active file

type Link struct {
	Location string
	Broken   bool
}

Link symlink

type Pseudofile

type Pseudofile struct {
	Name     string
	FullPath string
	IsDir    bool
	IsReal   bool
	IsLink   bool
	Link     Link
	F        os.FileInfo
}

Pseudofile file info

func (*Pseudofile) Copy

func (f *Pseudofile) Copy(dt *Tree, directory string)

Copy file to new location

func (*Pseudofile) Move

func (f *Pseudofile) Move(dt *Tree, directory string)

Move file to new location

type Tree

type Tree map[string]*Directory

Tree holds multiple directories

func Init

func Init(c *config.Config, cd string) (dt *Tree, err error)

Init initialize

func (*Tree) ChangeDirectory

func (dt *Tree) ChangeDirectory(dirname string) (err error)

ChangeDirectory cd

func (*Tree) ReadChild

func (dt *Tree) ReadChild(cd string) (err error)

ReadChild change directory

func (*Tree) SelectFile

func (dt *Tree) SelectFile(direction int, cd string) (err error)

SelectFile change active file

func (*Tree) SelectFileByName added in v0.0.6

func (dt *Tree) SelectFileByName(cd, file string) (err error)

SelectFileByName change active file

func (*Tree) Update

func (dt *Tree) Update(cd string) (err error)

Update sync directory

Jump to

Keyboard shortcuts

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