-
Notifications
You must be signed in to change notification settings - Fork 2
/
default.lua
63 lines (49 loc) · 1.34 KB
/
default.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
pwd = "/"
print ("~~~~~~~~~~~~~~ begin lua code. Respect my authoritah!")
filename = "default.lua"
a = lkl.stat(filename)
print (a["size"])
for i,v in pairs(a) do
print (i,v)
end
print ("after printing the table")
ret = lkl.file_rename(pwd .. "test1", pwd .. "test2")
print("file_rename returned", ret)
ret = lkl.file_rename(pwd .. "test2", pwd .. "test1");
print("file_rename returned", ret)
ret = lkl.file_copy("test1", "copydest");
print("file_copy returned", ret)
ret = lkl.dir_make("subdir");
print("dir_make returned", ret)
ret = lkl.dir_make_rec("subdir2/subdir3");
print("dir_make_rec returned", ret)
a = lkl.dir(".")
if a == nil then
print "suck to be a nilval"
else
t = {}
print("before insert");
for i in a do
table.insert(t,i)
end
print("before sort");
table.sort(t)
for i,v in ipairs(t) do
print (i,v)
end
end
a,b = lkl.get_pid()
print ("a=", a, "b=", b)
ret = lkl.chdir("/")
print ("chdir returned ", ret)
ret, reason = lkl.getcwd()
print ("getcwd returned ", ret, reason)
ret = lkl.mkdir("lklmkdir")
print ("lkl.mkdir returned ", ret)
ret = lkl.rmdir("lklmkdir")
print ("lkl.rmdir returned ", ret)
ret, str = lkl.utime(filename, 0, 0)
print("lkl.utime returned ", ret, str)
ret, str = lkl.utimes(filename, 0, 0)
print("lkl.utimes returned ", ret, str)
print ("~~~ end of the world")