Lua读取文件时,一次性读取整个文件,输入文件的最大支持多大?
找了官网文档也没找到说明,于是索性去看lua的源码。
首先从liolib.c 开始看:
/*
** functions for 'io' library
*/
static const luaL_Reg iolib[] = {
{
"close", io_close},
{
"flush", io_flush},
{
"input", io_input},
{
"lines", io_lines},
{
"open", io_open},
{
"output", io_output},
{
"popen", io_popen},
{
"read", io_read},
{
"tmpfile", io_tmpfile},
{
"type", io_type},
{
"write", io_write},
{
NULL, NULL}
};
/*
** methods for file handles
*/
static const luaL_Reg flib[] = {
{
"close", f_close},
{
"flush", f_flush},
{
"lines", f_lines},
{
"read", f_read},
{
"seek", f_seek},
{
"setvbuf", f_setvbuf},
{
"write", f_write}