lua-users home
lua-l archive

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


Hi,
 
I'm trying to compile Lua on an Linux machine with luasocket dynamically linked in.
 
I'm getting below error when i am trying to run a lua script which contains ftp functionalities.
 
lua: socket/ftp.lua:220: attempt to call field 'try' (a nil value)
stack traceback:
        [C]: in function 'get'
        /tffs0/testftp.lua:4: in main chunk
        [C]: ?
 
 
 
I got some pointers like i have to compile my code statically by including below things 
appropriately. And When we try to  call require(), it will not try to load the
shared library.

 
1)You can use the package.preload table for this.
2)Make sure you add an entry package.preload["socket.core"], whose value
is the C function (use lua_pushcfunction) luaopen_socket_core. Do the same with package.preload["mime.core"] and the function
luaopen_mime_core. When you call require(), it will not try to load the
shared library".
could you please be more clear like how to add an entry of package.preload["socket.core"],
in which file to include & about package.preload table since i am bit new to LUA Sockets.
 
 
Thanks & Regards,
Adimurthy
 

Please do not print this email unless it is absolutely necessary.

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com