lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi Oliver:

On Fri, 25 Mar 2022 at 12:24, Oliver Kroth <oliver.kroth@nec-i.de> wrote:
> I do know that. I always use binary mode with files and remove or add
> '\r' as needed.

I have not used OSs where binary mode matter for many years, but
esentially I do the same.

> Example: A Windows users uploads via HTTP a configuration file onto a
> Linux based device.

Lots of people do this to me, and it is correct. I normalize
everything before ingestion, either on the fly or beforehand. What I
do not not normally do is store the file as it comes, I store it in
the local text format, which fo me is always unix. ( It may hit the
disc on windows native format on a staging area, but when I  put it in
its place I normalize it, so only the upload process needs to worry,
and I also get rid of win-1252, BOMs and other things on the fly ).
While it has CR it is a temporary file I got from the net, when it
goes to a place where it becomes a config file I already have it
normalized, so every local tool can treat as a text file. This is
needed as in Linux you use a lot of tools on config and other things,
and its better to have them work ok ( not that they care, normally the
extra CR is just a trailing space which does not hurt, but better zap
it ).

Regards.
   Francisco Olarte.