Skip to content

Commit 86de838

Browse files
committed
cleanup; move ./etc into ./samples and mark 'unsupported'
1 parent 7187be8 commit 86de838

18 files changed

+98
-112
lines changed

.luacheckrc

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ include_files = {
1515
}
1616

1717
exclude_files = {
18-
"etc/*.lua",
19-
"etc/**/*.lua",
2018
"test/*.lua",
2119
"test/**/*.lua",
2220
"samples/*.lua",

etc/README

-89
This file was deleted.

luasocket-scm-3.rockspec

-1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,5 @@ build = {
129129
copy_directories = {
130130
"docs"
131131
, "samples"
132-
, "etc"
133132
, "test" }
134133
}

makefile.dist

+11-17
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,17 @@ SAMPLES = \
2222
samples/lpr.lua \
2323
samples/talker.lua \
2424
samples/tinyirc.lua
25-
26-
ETC = \
27-
etc/README \
28-
etc/b64.lua \
29-
etc/check-links.lua \
30-
etc/check-memory.lua \
31-
etc/dict.lua \
32-
etc/dispatch.lua \
33-
etc/eol.lua \
34-
etc/forward.lua \
35-
etc/get.lua \
36-
etc/lp.lua \
37-
etc/qp.lua \
38-
etc/tftp.lua
25+
samples/b64.lua \
26+
samples/check-links.lua \
27+
samples/check-memory.lua \
28+
samples/dict.lua \
29+
samples/dispatch.lua \
30+
samples/eol.lua \
31+
samples/forward.lua \
32+
samples/get.lua \
33+
samples/lp.lua \
34+
samples/qp.lua \
35+
samples/tftp.lua
3936

4037
SRC = \
4138
src/makefile \
@@ -117,9 +114,6 @@ dist:
117114
cp -vf README.md $(DIST)
118115
cp -vf $(MAKE) $(DIST)
119116

120-
mkdir -p $(DIST)/etc
121-
cp -vf $(ETC) $(DIST)/etc
122-
123117
mkdir -p $(DIST)/src
124118
cp -vf $(SRC) $(DIST)/src
125119

samples/README

+87-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,95 @@
11
This directory contains some sample programs using
22
LuaSocket. This code is not supported.
33

4+
tftp.lua -- Trivial FTP client
5+
6+
This module implements file retrieval by the TFTP protocol.
7+
Its main use was to test the UDP code, but since someone
8+
found it usefull, I turned it into a module that is almost
9+
official (no uploads, yet).
10+
11+
dict.lua -- Dict client
12+
13+
The dict.lua module started with a cool simple client
14+
for the DICT protocol, written by Luiz Henrique Figueiredo.
15+
This new version has been converted into a library, similar
16+
to the HTTP and FTP libraries, that can be used from within
17+
any luasocket application. Take a look on the source code
18+
and you will be able to figure out how to use it.
19+
20+
lp.lua -- LPD client library
21+
22+
The lp.lua module implements the client part of the Line
23+
Printer Daemon protocol, used to print files on Unix
24+
machines. It is courtesy of David Burgess! See the source
25+
code and the lpr.lua in the examples directory.
26+
27+
b64.lua
28+
qp.lua
29+
eol.lua
30+
31+
These are tiny programs that perform Base64,
32+
Quoted-Printable and end-of-line marker conversions.
33+
34+
get.lua -- file retriever
35+
36+
This little program is a client that uses the FTP and
37+
HTTP code to implement a command line file graber. Just
38+
run
39+
40+
lua get.lua <remote-file> [<local-file>]
41+
42+
to download a remote file (either ftp:// or http://) to
43+
the specified local file. The program also prints the
44+
download throughput, elapsed time, bytes already downloaded
45+
etc during download.
46+
47+
check-memory.lua -- checks memory consumption
48+
49+
This is just to see how much memory each module uses.
50+
51+
dispatch.lua -- coroutine based dispatcher
52+
53+
This is a first try at a coroutine based non-blocking
54+
dispatcher for LuaSocket. Take a look at 'check-links.lua'
55+
and at 'forward.lua' to see how to use it.
56+
57+
check-links.lua -- HTML link checker program
58+
59+
This little program scans a HTML file and checks for broken
60+
links. It is similar to check-links.pl by Jamie Zawinski,
61+
but uses all facilities of the LuaSocket library and the Lua
62+
language. It has not been thoroughly tested, but it should
63+
work. Just run
64+
65+
lua check-links.lua [-n] {<url>} > output
66+
67+
and open the result to see a list of broken links. Make sure
68+
you check the '-n' switch. It runs in non-blocking mode,
69+
using coroutines, and is MUCH faster!
70+
71+
forward.lua -- coroutine based forward server
72+
73+
This is a forward server that can accept several connections
74+
and transfers simultaneously using non-blocking I/O and the
75+
coroutine-based dispatcher. You can run, for example
76+
77+
lua forward.lua 8080:proxy.com:3128
78+
79+
to redirect all local conections to port 8080 to the host
80+
'proxy.com' at port 3128.
81+
82+
unix.c and unix.h
83+
84+
This is an implementation of Unix local domain sockets and
85+
demonstrates how to extend LuaSocket with a new type of
86+
transport. It has been tested on Linux and on Mac OS X.
87+
488
listener.lua -- socket to stdout
589
talker.lua -- stdin to socket
690

791
listener.lua and talker.lua are about the simplest
8-
applications you can write using LuaSocket. Run
92+
applications you can write using LuaSocket. Run
993

1094
'lua listener.lua' and 'lua talker.lua'
1195

@@ -17,13 +101,13 @@ be printed by listen.lua.
17101
This is a cool program written by David Burgess to print
18102
files using the Line Printer Daemon protocol, widely used in
19103
Unix machines. It uses the lp.lua implementation, in the
20-
etc directory. Just run 'lua lpr.lua <filename>
104+
samples directory. Just run 'lua lpr.lua <filename>
21105
queue=<printername>' and the file will print!
22106

23107
cddb.lua -- CDDB client
24108

25109
This is the first try on a simple CDDB client. Not really
26-
useful, but one day it might become a module.
110+
useful, but one day it might become a module.
27111

28112
daytimeclnt.lua -- day time client
29113

etc/b64.lua samples/b64.lua

File renamed without changes.
File renamed without changes.
File renamed without changes.

etc/cookie.lua samples/cookie.lua

File renamed without changes.

etc/dict.lua samples/dict.lua

File renamed without changes.
File renamed without changes.

etc/eol.lua samples/eol.lua

File renamed without changes.
File renamed without changes.

etc/get.lua samples/get.lua

File renamed without changes.

etc/links samples/links

File renamed without changes.

etc/lp.lua samples/lp.lua

File renamed without changes.

etc/qp.lua samples/qp.lua

File renamed without changes.

etc/tftp.lua samples/tftp.lua

File renamed without changes.

0 commit comments

Comments
 (0)