Mercurial > luasocket
comparison etc/eol.lua @ 0:4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
author | Eric Wing <ewing . public |-at-| gmail . com> |
---|---|
date | Tue, 26 Aug 2008 18:40:01 -0700 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4b915342e2a8 |
---|---|
1 ----------------------------------------------------------------------------- | |
2 -- Little program to adjust end of line markers. | |
3 -- LuaSocket sample files | |
4 -- Author: Diego Nehab | |
5 -- RCS ID: $Id: eol.lua,v 1.8 2005/11/22 08:33:29 diego Exp $ | |
6 ----------------------------------------------------------------------------- | |
7 local mime = require("mime") | |
8 local ltn12 = require("ltn12") | |
9 local marker = '\n' | |
10 if arg and arg[1] == '-d' then marker = '\r\n' end | |
11 local filter = mime.normalize(marker) | |
12 local source = ltn12.source.chain(ltn12.source.file(io.stdin), filter) | |
13 local sink = ltn12.sink.file(io.stdout) | |
14 ltn12.pump.all(source, sink) |