- 积分
- 41880
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-8-28
- 最后登录
- 1970-1-1
|
发表于 2015-12-9 20:19:08
|
显示全部楼层
read (filename)
This functions reads individual records from file filename. Repeated calls must be made to read consecutive records. The result is a string containing two lines: the first line is the return code, the 2nd line is the record read from the file. The record may be a maximum of 80 characters. Use the sublin function to separate the result. Return codes are:
0 - ok
1 - open error
2 - end of file
8 - file open for write
9 - I/O error
Files are opened when the first call to read is made for a particular file name. Files are closed when the execution of the script file terminates (note that files remain open between function calls, etc).
write (filename, record <, append>)
This functions writes records to output file filename. On the first call to write for a particular file, the file is opened in write mode. This will destroy an existing file! If you use the optional append flag, the file will be opened in append mode, and all writes will be appended to the end of the file. Return codes are:
0 - ok
1 - open error
8 - file open for read |
|