[Freeswitch-users] require in LUA

Chad Phillips chad at apartmentlines.com
Tue Dec 27 04:11:56 MSK 2011


check conf/autoload_configs/lua.conf.xml.  the module-directory and script-directory params contain the various paths that require will search for c modules and lua scripts respectively.

the question marks are replaced by what you pass to require, with the exception that dots are converted to path separators.

so if you have '/path/to/scripts/?.lua', and you do 'require "foo.lua"', it will look for '/path/to/scripts/foo/lua.lua' (i.e., replacing the ? with foo/lua).  if you 'require "foo"', then you'll of course get '/path/to/scripts/foo.lua'.

hope this helps.

hunmonk  


Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Monday, December 26, 2011 at 8:48 AM, Juan Antonio Ibañez Santorum wrote:

> Hello!
>  
>    I have one doubt about requier in Lua. I have one module coded in a fille called logging.lua. Why must I create '/usr/local/share/lua/5.1/logging/lua.lua' to be included in my main lua script instead creating '/usr/local/share/lua/5.1/logging.lua'?  
>  
> Regards  
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org (mailto:consulting at freeswitch.org)
> http://www.freeswitchsolutions.com
>  
> 
> 
>  
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>  
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org (mailto:FreeSWITCH-users at lists.freeswitch.org)
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>  
>  


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20111226/d205e704/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list