goos

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

README

goos GoDoc

Lua module for os.

Usage

local goos = require("goos")

-- stat
local stat, err = goos.stat("./filename")
if err then error(err) end
print(stat.is_dir)
print(stat.size)
print(stat.mod_time)
print(stat.mode)

-- hostname
local hostname, err = goos.hostname()
if err then error(err) end
print(hostname)

-- get_pagesize
local page_size = goos.get_pagesize()
if not(page_size > 0) then error("bad pagesize") end

-- mkdir_all
goos.mkdir_all("./test/test_dir/test_dir/all")
local stat, err = goos.stat("./test/test_dir/test_dir/all")
if err then error(err) end

Documentation

Overview

Package goos implements golang package os functionality for lua.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Getpagesize

func Getpagesize(L *lua.LState) int

Getpagesize lua goos.pagesize() return number

func Hostname

func Hostname(L *lua.LState) int

Hostname lua goos.hostname() returns (string, error)

func Loader

func Loader(L *lua.LState) int

Loader is the module loader function.

func MkdirAll

func MkdirAll(L *lua.LState) int

MkdirAll lua goos.mkdir_all() return err

func Preload

func Preload(L *lua.LState)

Preload adds goos to the given Lua state's package.preload table. After it has been preloaded, it can be loaded using require:

local goos = require("goos")

func Stat

func Stat(L *lua.LState) int

Stat lua goos.stat(filename) returns (table, err)

Types

This section is empty.

Jump to

Keyboard shortcuts

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