Time for an 2014 update…
This commit is contained in:
parent
372c577f83
commit
09687c4926
2520 changed files with 34227 additions and 7318 deletions
2
Task/Hostname/AutoHotkey/hostname-2.ahk
Normal file
2
Task/Hostname/AutoHotkey/hostname-2.ahk
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
for objItem in ComObjGet("winmgmts:\\.\root\CIMV2").ExecQuery("SELECT * FROM Win32_ComputerSystem")
|
||||
MsgBox, % "Hostname:`t" objItem.Name
|
||||
31
Task/Hostname/Limbo/hostname.limbo
Normal file
31
Task/Hostname/Limbo/hostname.limbo
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
implement Hostname;
|
||||
|
||||
include "sys.m"; sys: Sys;
|
||||
include "draw.m";
|
||||
|
||||
Hostname: module {
|
||||
init: fn(nil: ref Draw->Context, nil: list of string);
|
||||
};
|
||||
|
||||
init(nil: ref Draw->Context, nil: list of string)
|
||||
{
|
||||
sys = load Sys Sys->PATH;
|
||||
buf := array[Sys->ATOMICIO] of byte;
|
||||
|
||||
fd := sys->open("/dev/sysname", Sys->OREAD);
|
||||
if(fd == nil)
|
||||
die("Couldn't open /dev/sysname");
|
||||
|
||||
n := sys->read(fd, buf, len buf - 1);
|
||||
if(n < 1)
|
||||
die("Couldn't read /dev/sysname");
|
||||
|
||||
buf[n++] = byte '\n';
|
||||
sys->write(sys->fildes(1), buf, n);
|
||||
}
|
||||
|
||||
die(s: string)
|
||||
{
|
||||
sys->fprint(sys->fildes(2), "hostname: %s: %r", s);
|
||||
raise "fail:errors";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue