Format of options file
RS
richard22j at zoho.com
Mon Mar 5 08:04:06 PST 2018
On 05/03/2018 14:19, Ralph Corderoy wrote:
>> I suggested ignoring CR because they are there. Ideally they would
>> not be there. The files are internal to get_iplayer so they can be in
>> any format.
>
> Only if you don't want them to be native text files, editable on that
> system with a text editor by any user. And I thought you do because you
> have been editing them.
Hi Ralph
I have only ever edited the options file by running the script you gave
me to convert CR LF to LF. There is no need to edit the file directly
because it can be displayed with --prefs-show. Entries can be changed
and added with --prefs-add and removed with --prefs-del. The format of
those commands and the display are different from each other and from
the file format, so editing directly would be a recipe for confusion.
>
>> 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.
Best wishes
Richard
More information about the get_iplayer
mailing list