[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: lua_dofile? passing args to a lua script from c
- From: Mike Spencer <mike@...>
- Date: Mon, 2 Jun 2003 14:06:53 +0100
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...
e.g.
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" )
readfrom()
dprintf( 'done!\n' )
thanks!