From 86de838eb5ed49711be8d62e01255cc2ccd3342e Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Wed, 23 Mar 2022 16:05:11 +0100 Subject: cleanup; move ./etc into ./samples and mark 'unsupported' --- samples/eol.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 samples/eol.lua (limited to 'samples/eol.lua') diff --git a/samples/eol.lua b/samples/eol.lua new file mode 100644 index 0000000..eeaf0ce --- /dev/null +++ b/samples/eol.lua @@ -0,0 +1,13 @@ +----------------------------------------------------------------------------- +-- Little program to adjust end of line markers. +-- LuaSocket sample files +-- Author: Diego Nehab +----------------------------------------------------------------------------- +local mime = require("mime") +local ltn12 = require("ltn12") +local marker = '\n' +if arg and arg[1] == '-d' then marker = '\r\n' end +local filter = mime.normalize(marker) +local source = ltn12.source.chain(ltn12.source.file(io.stdin), filter) +local sink = ltn12.sink.file(io.stdout) +ltn12.pump.all(source, sink) -- cgit v1.2.3-55-g6feb