diff options
Diffstat (limited to 'etc/README')
-rw-r--r-- | etc/README | 30 |
1 files changed, 19 insertions, 11 deletions
@@ -4,34 +4,42 @@ This directory contains code that is more useful than the examples. This code | |||
4 | lua.lua | 4 | lua.lua |
5 | 5 | ||
6 | These are modules to suport dynamic loading of LuaSocket by the stand alone | 6 | These are modules to suport dynamic loading of LuaSocket by the stand alone |
7 | Lua Interpreter with the use of the "require" function. For my Mac OS X | 7 | Lua Interpreter with the use of new "require" and "requirelib" functions. |
8 | system, I place all files in /Users/diego/tec/luasocket | 8 | For my Mac OS X box, for instance, I place all files in |
9 | and set the following environment variables: | 9 | /Users/diego/tec/luasocket and set the following environment variables: |
10 | 10 | ||
11 | LUA_PATH=/Users/diego/tec/luasocket/?.lua | ||
12 | LUA_INIT=@/Users/diego/tec/luasocket/lua.lua | 11 | LUA_INIT=@/Users/diego/tec/luasocket/lua.lua |
13 | LUA_FUNCNAME=? | 12 | LUA_PATH=/Users/diego/tec/luasocket/?.lua;?.lua |
14 | LUA_LIBNAME=/Users/diego/tec/luasocket/?.dylib | 13 | LUA_PATHLIB=/Users/diego/tec/luasocket/?.dylib;?.dylib |
15 | 14 | ||
16 | With that, I can run any luasocket application with the command line: | 15 | With that, I can run any luasocket application with the command line: |
17 | 16 | ||
18 | lua -l socket <script> | 17 | lua <script> |
19 | 18 | ||
19 | as long as the script uses "require" to load the needed namespaces. | ||
20 | Much nicer than having to build a new executable just to initialize | 20 | Much nicer than having to build a new executable just to initialize |
21 | LuaSocket! | 21 | LuaSocket! |
22 | 22 | ||
23 | |||
24 | tftp.lua -- Trivial FTP client | 23 | tftp.lua -- Trivial FTP client |
25 | 24 | ||
26 | This module implements file retrieval by the TFTP protocol. Its main use | 25 | This module implements file retrieval by the TFTP protocol. Its main use |
27 | is to test the UDP code, but someone might find it usefull. | 26 | was to test the UDP code, but since someone found it usefull, I turned it |
27 | into a module that is almost official (no uploads, yet). | ||
28 | |||
29 | dict.lua -- Dict client | ||
30 | |||
31 | The dict.lua module started with a cool simple client for the DICT | ||
32 | protocol, written by Luiz Henrique Figueiredo. This new version has been | ||
33 | converted into a library, similar to the HTTP and FTP libraries, that can | ||
34 | be used from within any luasocket application. Take a look on the source | ||
35 | code and you will be able to figure out how to use it. | ||
28 | 36 | ||
29 | get.lua -- file retriever | 37 | get.lua -- file retriever |
30 | 38 | ||
31 | This little program is a client that uses the FTP and HTTP code to | 39 | This little program is a client that uses the FTP and HTTP code to |
32 | implement a command line file graber. Just run | 40 | implement a command line file graber. Just run |
33 | 41 | ||
34 | lua -l socket get.lua <remote-file> [<local-file>] | 42 | lua get.lua <remote-file> [<local-file>] |
35 | 43 | ||
36 | to download a remote file (either ftp:// or http://) to the specified | 44 | to download a remote file (either ftp:// or http://) to the specified |
37 | local file. The program also prints the download throughput, elapsed | 45 | local file. The program also prints the download throughput, elapsed |
@@ -44,7 +52,7 @@ similar to check-links.pl by Jamie Zawinski, but uses all facilities of | |||
44 | the LuaSocket library and the Lua language. It has not been thoroughly | 52 | the LuaSocket library and the Lua language. It has not been thoroughly |
45 | tested, but it should work. Just run | 53 | tested, but it should work. Just run |
46 | 54 | ||
47 | lua -l socket check-links.lua {<url>} > output | 55 | lua check-links.lua {<url>} > output |
48 | 56 | ||
49 | and open the result to see a list of broken links. | 57 | and open the result to see a list of broken links. |
50 | 58 | ||