Almost ready to release.
This commit is contained in:
parent
773e35ced3
commit
a32c6d9140
38 changed files with 115 additions and 383 deletions
|
@ -63,24 +63,28 @@ the package scheme will likely already have been answered.
|
|||
|
||||
<h3>Directory structure</h3>
|
||||
|
||||
<p> The standard distribution reserves a directory to be the root of
|
||||
the libraries installed
|
||||
on a given system. Let's call this directory <tt><ROOT></tt>.
|
||||
On my system, this is the <tt>/usr/local/share/lua/5.0</tt> directory.
|
||||
Here is the standard LuaSocket distribution directory structure:</p>
|
||||
<p> On Unix systems, the standard distribution uses two base
|
||||
directories, one for system dependent files, and another for system
|
||||
independent files. Let's call these directories <tt><LIB></tt>
|
||||
and <tt><SHARE></tt>, respectively.
|
||||
For instance, in my laptop, I use '<tt>/usr/local/lib/lua/5.0</tt>' for
|
||||
<tt><LIB></tt> and '<tt>/usr/local/share/lua/5.0</tt>' for
|
||||
<tt><SHARE></tt>. On Windows, only one directory is used, say
|
||||
'<tt>c:\program files\lua\5.0</tt>'. Here is the standard LuaSocket
|
||||
distribution directory structure:</p>
|
||||
|
||||
<pre class=example>
|
||||
<ROOT>/compat-5.1.lua
|
||||
<ROOT>/ltn12.lua
|
||||
<ROOT>/mime/init.lua
|
||||
<ROOT>/mime/core.dll
|
||||
<ROOT>/socket/init.lua
|
||||
<ROOT>/socket/core.dll
|
||||
<ROOT>/socket/http.lua
|
||||
<ROOT>/socket/tp.lua
|
||||
<ROOT>/socket/ftp.lua
|
||||
<ROOT>/socket/smtp.lua
|
||||
<ROOT>/socket/url.lua
|
||||
<SHARE>/compat-5.1.lua
|
||||
<SHARE>/ltn12.lua
|
||||
<SHARE>/mime/init.lua
|
||||
<LIB>/mime/core.dll
|
||||
<SHARE>/socket/init.lua
|
||||
<LIB>/socket/core.dll
|
||||
<SHARE>/socket/http.lua
|
||||
<SHARE>/socket/tp.lua
|
||||
<SHARE>/socket/ftp.lua
|
||||
<SHARE>/socket/smtp.lua
|
||||
<SHARE>/socket/url.lua
|
||||
</pre>
|
||||
|
||||
<p> Naturally, on Unix systems, <tt>core.dll</tt>
|
||||
|
@ -91,7 +95,7 @@ environment variables need to be set. The first environment variable tells
|
|||
the interpreter to load the <tt>compat-5.1.lua</tt> module at startup: </p>
|
||||
|
||||
<pre class=example>
|
||||
LUA_INIT=@<ROOT>/compat-5.1.lua
|
||||
LUA_INIT=@<SHARE>/compat-5.1.lua
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
|
@ -101,13 +105,12 @@ directories and with the appropriate filename extensions.
|
|||
</p>
|
||||
|
||||
<pre class=example>
|
||||
LUA_PATH=<ROOT>/?.lua;?.lua
|
||||
LUA_CPATH=<ROOT>/?.dll;?.dll
|
||||
LUA_PATH=<SHARE>/?.lua;?.lua
|
||||
LUA_CPATH=<LIB>/?.dll;?.dll
|
||||
</pre>
|
||||
|
||||
<p> Again, naturally, in Unix the shared library extension would be
|
||||
<tt>.so</tt> instead of <tt>.dll</tt> and on Mac OS X it would be
|
||||
<tt>.dylib</tt></p>
|
||||
<p> Again, naturally, on Unix systmems the shared library extension would be
|
||||
<tt>.so</tt> instead of <tt>.dll</tt></p>
|
||||
|
||||
<h3>Using LuaSocket</h3>
|
||||
|
||||
|
@ -118,8 +121,8 @@ it should be easy to use LuaSocket. Just fire the interpreter and use the
|
|||
<pre class=example>
|
||||
Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio
|
||||
> socket = require("socket")
|
||||
> print(socket.VERSION)
|
||||
--> LuaSocket 2.0 (beta3)
|
||||
> print(socket._VERSION)
|
||||
--> LuaSocket 2.0
|
||||
</pre>
|
||||
|
||||
<p> Each module loads their dependencies automatically, so you only need to
|
||||
|
@ -128,7 +131,8 @@ load the modues you directly depend upon: <p>
|
|||
<pre class=example>
|
||||
Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio
|
||||
> http = require("socket.http")
|
||||
> print(http.request("http://www.tecgraf.puc-rio.br/luasocket"))
|
||||
>
|
||||
print(http.request("http://www.cs.princeton.edu/~diego/professional/luasocket"))
|
||||
--> homepage gets dumped to terminal
|
||||
</pre>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue