iolib

package
Version: v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	*os.File
	// contains filtered or unexported fields
}

File embeds an os.File and provides an IsClosed method.

func FileArg

func FileArg(c *rt.GoCont, n int) (*File, error)

FileArg turns a continuation argument into a *File.

func OpenFile

func OpenFile(name string, mode string) (*File, error)

OpenFile opens a file with the given name in the given Lua mode. A finaliser is set on the returned file (via runtime.SetFinalizer) so that it is automatically closed when garbage collected.

func TempFile

func TempFile() (*File, error)

TempFile makes a temporary file, which will be removed when closed. A finaliser is set on the returned file (via runtime.SetFinalizer) so that it is automatically closed when garbage collected.

func ValueToFile

func ValueToFile(v rt.Value) (*File, bool)

ValueToFile turns a Lua value to a *File if possible.

func (*File) Close

func (f *File) Close() error

Close closes the file.

func (*File) IsClosed

func (f *File) IsClosed() bool

IsClosed returns true iff the file is known to be closed.

func (*File) String

func (f *File) String() string

String returns a string description of the file.

Source Files

Jump to

Keyboard shortcuts

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