Format of options file
RS
richard22j at zoho.com
Mon Mar 5 12:04:09 PST 2018
On 05/03/2018 16:04, I wrote:
>>
>>> I would have thought it sensible to use LF as a line terminator for
>>> get_iplayer's internal files across all operating systems. The
>>> question is how the CR are getting into the files in Windows.
>>
>> I pre-empted this in the email you're replying to.
>>
>> Because C has lines terminated by LF, like Unix, C libraries on
>> Windows convert CRLF to LF on reading a text file, and do the
>> reverse on writing. Perl implements that.
>>
> If the conversion only occurs in Windows, that's no good. I have cache,
> history and options files created in Windows with CR LF. I want
> get_iplayer to be able to read and update those files in Linux. Ideally
> I want to be able to put them on a shared drive so that both
> installations can update them. I thought from the article I read chomp
> VARIABLE could do that, but clearly I have misunderstood.
>
It's worse than I thought. I had got the impression from the perlport
perldoc that if replaced \n with \012 in a print statement I would get a
LF on its own in Windows. I don't. If I insert \015 I can have a CR on
its own, but \012 is still replaced with CR LF.
This article
http://www.perlmonks.org/?node=binmode
says I can use binmode, so that may be an answer. It's quite old, so it
may no longer apply.
Best wishes
Richard
More information about the get_iplayer
mailing list