files

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetList

func GetList(t *term.ViewPort, baseFolder string) []os.DirEntry

GetList returns a list of files in the specified base folder. If an error occurs, an error message is displayed using the provided terminal.

func Open

func Open(p *page.Page, filename string) (*os.File, error)

Open opens a file for writing.

Parameters: t - the terminal to use for output. filename - the name of the file to open.

Returns: a file pointer, or an error if any occurred while opening the file.

func Read

func Read(p *page.Page, file *os.File) ([]byte, error)

func ReadFile

func ReadFile(p *page.Page, fileName string) ([]byte, error)

func WriteString

func WriteString(p *page.Page, file *os.File, content string) error

func WriteStringSlice

func WriteStringSlice(p *page.Page, file *os.File, content []string) error

WriteStringSlice writes a slice of strings to a file.

Parameters: t - the terminal to use for output. file - the file to write to. content - the slice of strings to write to the file.

Returns: an error if any occurred while writing to the file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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