Skip to content

moonlibs/hostname

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Get/set hostname from lua

Simple ffi wrapper over gethostname(2) and sethostname(2)

local hostname = require 'hostname'

-- Simple get hostname

print("My hostname is", hostname())
-- my.example.com

-- Module interface

print("My hostname is", hostname.get())
-- my.example.com

print("My short host is", hostname.host())
-- my

-- Set hostname into name
local name = "newhost"
hostname.set(name)
-- If something went wrong, error will be raised

About

Get/set hostname from lua with ffi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages