blob: 4a8a72a0020013441e9ad7bc0b074853da9cf4e5 (
plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
[stdin]
description = '标准输入。'
[stdout]
description = '标准输出。'
[stderr]
description = '标准错误。'
[close]
description = '关闭 `file` 或默认输出文件。'
[flush]
description = '将写入的数据保存到默认输出文件中。'
[input]
description = '设置 `file` 为默认输入文件。'
["lines Lua 5.1"]
description = [[
------
```lua
for c in io.lines(filename, ...) do
body
end
```
]]
[[.enums]]
name = 'mode'
enum = '*n'
description = '读取一个数字,根据 Lua 的转换文法返回浮点数或整数。'
``````````
name = 'mode'
enum = '*a'
description = '从当前位置开始读取整个文件。'
``````````
name = 'mode'
enum = '*l'
description = '读取一行并忽略行结束标记。'
``````````
name = 'mode'
enum = '*L'
description = '读取一行并保留行结束标记。'
``````````
name = 'mode'
code = 'number'
description = '读取一个不超过这个数量字节数的字符串。'
["lines Lua 5.3"]
description = [[
------
```lua
for c in io.lines(filename, ...) do
body
end
```
]]
[[.enums]]
name = 'mode'
enum = 'n'
description = '读取一个数字,根据 Lua 的转换文法返回浮点数或整数。'
``````````
name = 'mode'
enum = 'a'
description = '从当前位置开始读取整个文件。'
``````````
name = 'mode'
enum = 'l'
description = '读取一行并忽略行结束标记。'
``````````
name = 'mode'
enum = 'L'
description = '读取一行并保留行结束标记。'
``````````
name = 'mode'
code = 'number'
description = '读取一个不超过这个数量字节数的字符串。'
[open]
description = '用字符串 `mode` 指定的模式打开一个文件。'
[[.enums]]
name = 'mode'
enum = 'r'
description = '读模式。'
``````````
name = 'mode'
enum = 'w'
description = '写模式。'
``````````
name = 'mode'
enum = 'a'
description = '追加模式。'
``````````
name = 'mode'
enum = 'r+'
description = '更新模式,所有之前的数据都保留。'
``````````
name = 'mode'
enum = 'w+'
description = '更新模式,所有之前的数据都删除。'
``````````
name = 'mode'
enum = 'a+'
description = '追加更新模式,所有之前的数据都保留,只允许在文件尾部做写入。'
[output]
description = '设置 `file` 为默认输出文件。'
[popen]
description = '用一个分离进程开启程序 `prog` 。'
[[.enums]]
name = 'mode'
enum = 'r'
description = '从这个程序中读取数据。'
``````````
name = 'mode'
enum = 'w'
description = '向这个程序写入输入。'
["read Lua 5.1"]
description = '读文件 `file`, 指定的格式决定了要读什么。'
[[.enums]]
name = 'mode'
enum = '*n'
description = '读取一个数字,根据 Lua 的转换文法返回浮点数或整数。'
``````````
name = 'mode'
enum = '*a'
description = '从当前位置开始读取整个文件。'
``````````
name = 'mode'
enum = '*l'
description = '读取一行并忽略行结束标记。'
``````````
name = 'mode'
enum = '*L'
description = '读取一行并保留行结束标记。'
``````````
name = 'mode'
code = 'number'
description = '读取一个不超过这个数量字节数的字符串。'
["read Lua 5.3"]
description = '读文件 `file`, 指定的格式决定了要读什么。'
[[.enums]]
name = 'mode'
enum = 'n'
description = '读取一个数字,根据 Lua 的转换文法返回浮点数或整数。'
``````````
name = 'mode'
enum = 'a'
description = '从当前位置开始读取整个文件。'
``````````
name = 'mode'
enum = 'l'
description = '读取一行并忽略行结束标记。'
``````````
name = 'mode'
enum = 'L'
description = '读取一行并保留行结束标记。'
``````````
name = 'mode'
code = 'number'
description = '读取一个不超过这个数量字节数的字符串。'
[tmpfile]
description = '如果成功,返回一个临时文件的句柄。'
[type]
description = '检查 `obj` 是否是合法的文件句柄。'
[[.enums]]
name = 'type'
enum = 'file'
description = '是一个打开的文件句柄。'
``````````
name = 'type'
enum = 'closed file'
description = '是一个关闭的文件句柄。'
``````````
name = 'type'
code = 'nil'
description = '不是文件句柄。'
[write]
description = '将参数的值逐个写入默认输出文件。'
|