lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

i've noticed quite a few of you execute lua scripts from a command line and
are able to specify arguments,
i would like to do the same from within my C code...

c code...
lua_pushstring( L, "test.dat" );
lua_dofile( L, "import_data.lua" );

lua script...
dprintf( 'importing test data...\n' )
filename = arg[1]
dprintf( '%s', filename )   -- this is where i think it fails! :(
readfrom( filename )
file = read( "*a" )
dprintf( 'done!\n' )