Linuxcnc always wants to update my INI file

More
6 years 9 months ago #154668 by DC67
i did it via the selection menu but i had the same problem

Please Log in to join the conversation.

More
6 years 9 months ago #154694 by andypugh
Can you zip up the config folder and attach it, I will see if I can tell what is going on.

Please Log in to join the conversation.

More
6 years 9 months ago #154716 by DC67
Hello
Here is config zip

Attachment not found

Please Log in to join the conversation.

More
6 years 9 months ago #154719 by andypugh
This looks like a bug with the "GetFromIni" code in Linuxcnc

The simple workaround for you is to add a blank line (or a comment) before the [EMC] section of the INI.
For some reason if the very first line in the file is the [EMC] section it fails to find it.

I will try to fix that.

But you should be able to just add a line to Fenja.ini and all will be well.

Please Log in to join the conversation.

More
6 years 9 months ago #154721 by dgarrett
I think the problem is that the ini file was edited with
some program that adds a BOM "byte order mark" (efbb bf) at
the beginning of the file and the parsing in inifile.cc does
not handle BOMs -- not expected in linux.

Ref: en.wikipedia.org/wiki/Byte_order_mark

A brief web search notes that the dos2unix program fixes this:
Code:
$ xxd Fenja.ini |head -1 00000000: efbb bf5b 454d 435d 0a23 2054 6865 2076 ...[EMC].# The v $ dos2unix Fenja.ini $ xxd Fenja.ini |head -1 00000000: 5b45 4d43 5d0a 2320 5468 6520 7665 7273 [EMC].# The vers

Please Log in to join the conversation.

More
6 years 9 months ago #154727 by andypugh
I did look for whitespace in the editor, but the BOM is new to me.
But would certainly mess up the parser that looks for a lie beginning [EMC]

That said, a blank line fixes the issue easily, moving the BOM to an irrelevant line.

Please Log in to join the conversation.

More
6 years 9 months ago #154766 by DC67
Thanks for the solution. It worked! I wrote a comment in line one that reminds me not to delete this line :)

Please Log in to join the conversation.

Time to create page: 0.049 seconds
Powered by Kunena Forum