5 -- print ("testing...")
8 print ("create new ixp...")
9 x
= ixp
.new("unix!/tmp/ns.bart.:0/wmii")
11 -- print ("testing...")
15 x
:write ("/lbar/1", '#FF0000 #00FF00 #0000FF 1xxx')
18 data
= x
:read ("/lbar/1")
21 print ("reading with limit...")
22 data
,short
= x
:read ("/lbar/1", 8)
23 print (" " .. tostring(data
))
25 print (" ... error: " .. tostring(short
) .. ")")
27 print (" ... short read")
30 print ("reading a nonexistent file...")
31 data
,short
= x
:read ("/lbar/xxxxxxxxxxxxxxxxxxxxxxx")
32 print (" " .. tostring(data
))
34 print (" ... error: " .. short
)
36 print (" ... short read")
40 data
= x
:stat ("/event")
41 for k
,v
in pairs (data
) do
43 if type(v
) == "number" then
44 hex
= string.format(" (0x%x)",v
)
46 print (" "..k
.." = " .. tostring(v
) .. hex
)
49 print ("directory list...")
50 for data
in x
:idir ("/") do
52 if data
.modestr
:match("^d") then
55 print (" " .. data
.name
.. slash
)
59 print ("iterating...")
60 for ev
in x
:iread("/event") do
61 print ("ev: '" .. ev
.. "'")