mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-11-08 06:18:21 +01:00
bcc0c2a9f0
ltn12 and mime updated. smtp/ftp broken.
13 lines
360 B
Lua
13 lines
360 B
Lua
local source = ltn12.source.file(io.stdin)
|
|
local sink = ltn12.sink.file(io.stdout)
|
|
local convert
|
|
if arg and arg[1] == '-d' then
|
|
convert = mime.decode("base64")
|
|
else
|
|
local base64 = mime.encode("base64")
|
|
local wrap = mime.wrap()
|
|
convert = ltn12.filter.chain(base64, wrap)
|
|
end
|
|
source = ltn12.source.chain(source, convert)
|
|
ltn12.pump(source, sink)
|