NAME 9lua SYNOPSIS DESCRIPTION fd = p9.open(file [,mode]) mode: "r", "w", "rw", "wr", the default "r" p9.read(fd [,size]) size: integer (>0). if size is nil then read all data if size is given, p9.read() behaved sane as Plan9 read() p9.write(fd,data) data: string value (no default) p9.seek(fd,offset [,how]) offset: integer. the default is 0 how: "set","cur","end". the default is "set" p9.close(fd) same as Plan9 close() p9.bind(name,old [,flag]) same ad Plan9 command bind flag is "a","b","c" p9.unmount([name,] old) name may be absent, then old is assumed same ad Plan9 command unmount p9.dirstat(path) same as Plan9 dirstat() p9.dirwstat(path,dir) dir is a Lua table with mode, mtime, uid, gid for example dir={mode="755", gid="glenda"} p9.mkdir(path [,mode]) mode default is "777". note that created dir mode follows the mode of parent dir. p9.readdir(path [,flag]) -- returns table flag is true or nil, the default is nil if nil, the returnd table contains only true or false for each name, which denotes dir or not. if true, the returnd table contains dir attributes for the names p9.bit(n,op,m) n,m is a number op is "&", "|", "^", "<<", ">>" NB: now Lua support bit wise operation. p9.bit is obolete. p9.popen(prog) prog is rc command list. the usage example is f = p9.popen("ps") s = p9.read(f) p9.close(f) print(s) p9.fork() -- returns pid the usage example is pid = p9.fork() if pid > 0 then -- parent print("I am parent. My child is "..pid) print("waiting child to finish") s = p9.wait(pid) print("msg="..s) else print("I am child. I don't know my parent") p9.sleep(3) end p9.wait(pid) p9.alarm(timeout [,killflag]) I wander this is useful without notify? maybe obsoleted. execute with alarm timeout is much useful. p9.sleep(time) time in unit of second