ipe

package module
v0.0.0-...-410832e Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: Unlicense Imports: 9 Imported by: 0

README

Ipê (deprecated)

Deprecated License go.dev Go Report Card

A replacement for ls with some special features, like tree view and Git integration. Works as terminal program or Go library.

Inspired by jacwah/oak and ogham/exa.

Deprecated

Don't use it! I made this code trying to learn Go but I never finished it and I don't see any reason for doing it now.

To-do list

  • List directory contents
  • Identify and organize column sizes in long views
  • Make special features
    • Tree view (-t)
    • Separator of columns in long view (-S)
    • Flag to specify maximum depth of recursion (-D)
    • Flag to sort by an column/field (-s)
    • Flag to filter entries (-f)
    • Flag to show headers on long view (-h)
    • Differentiate files types
    • Flag to show directories first (--dirs-first)
    • Accept more than one value in filter and ignore flags
    • Flag to show number of hard links in long view (--links)
    • Flag to show number of file system blocks in long view (--blocks)
    • Flag to show group in long view (--group)
  • Define colors
  • Add Git integration
    • Ignore "Git ignored" files by default
    • Show files' Git status
  • Change it into a lib
  • Create formatters
  • Get inode, user and group in Windows
  • Define column alignment in long view

License

This project code is in the public domain. See the LICENSE file.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be in the public domain, without any additional terms or conditions.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotSymlink is returned when the method expects a symbolic link,
	// but the file is not.
	ErrNotSymlink = errors.New("the file is not a symbolic link")
)

Functions

This section is empty.

Types

type File

type File struct {
	// contains filtered or unexported fields
}

File represents a file.

func Read

func Read(path string) (File, error)

Read opens and reads the path and return its content.

func ReadDir

func ReadDir(path string) ([]File, error)

ReadDir opens and reads the directory path and return its contents.

func (File) AccTime

func (f File) AccTime() time.Time

AccTime returns the last access time.

func (File) Blocks

func (f File) Blocks() int64

Blocks returns the number of file system blocks.

func (File) Children

func (f File) Children() []File

Children opens a directory and reads its contents.

func (File) ClassifiedName

func (f File) ClassifiedName() string

ClassifiedName returns the name with an appended type indicator.

func (File) CrtTime

func (f File) CrtTime() time.Time

CrtTime returns the creation time.

func (File) DirSize

func (f File) DirSize() int64

DirSize return the length in bytes for all files inside the directory, recursively.

func (File) Fd

func (f File) Fd() int

Fd returns the Handle (in Windows) or File Descriptor (in any other OS).

func (f File) FollowLink() (File, error)

FollowLink returns the file that the symbolic link points to. If the file is not a symbolic link, it returns `ErrNotSymlink`.

func (File) FullName

func (f File) FullName() string

FullName returns the full and absolute path of the file.

func (File) Group

func (f File) Group() *user.Group

Group returns the group of the file's owner.

func (File) Inode

func (f File) Inode() uint64

Inode returns the file inode.

func (File) IsAppend

func (f File) IsAppend() bool

IsAppend reports whether `f` describes an append-only file.

func (File) IsDevice

func (f File) IsDevice() bool

IsDevice reports whether `f` describes a device file.

func (File) IsDir

func (f File) IsDir() bool

IsDir reports whether `f` describes a directory.

func (File) IsDotfile

func (f File) IsDotfile() bool

IsDotfile reports whether `f` describes a dotfile.

func (File) IsExclusive

func (f File) IsExclusive() bool

IsExclusive reports whether `f` describes an exclusive-use file.

func (File) IsNamedPipe

func (f File) IsNamedPipe() bool

IsNamedPipe reports whether `f` describes a named pipe (FIFO).

func (File) IsRegular

func (f File) IsRegular() bool

IsRegular reports whether `f` describes a regular file. That is, it tests that no mode type bits are set.

func (File) IsSocket

func (f File) IsSocket() bool

IsSocket reports whether `f` describes a socket.

func (f File) IsSymlink() bool

IsSymlink reports whether `f` describes a symbolic link.

func (File) IsTemporary

func (f File) IsTemporary() bool

IsTemporary reports whether `f` describes a temporary file (not backed up).

func (f File) Links() uint64

Links returns the number of hard links.

func (File) ModTime

func (f File) ModTime() time.Time

ModTime returns the last modification time.

func (File) Mode

func (f File) Mode() os.FileMode

Mode returns the file mode bits.

func (File) Name

func (f File) Name() string

Name returns the base name of the file.

func (File) Size

func (f File) Size() int64

Size returns the length in bytes for regular files.

func (File) Sys

func (f File) Sys() interface{}

Sys represents the underlying data source of the file.

func (File) User

func (f File) User() *user.User

User returns the user of the file's owner.

Directories

Path Synopsis
cmd
ipe

Jump to

Keyboard shortcuts

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