Linuxcnc always wants to update my INI file

More
12 Jan 2020 11:25 #154668 by DC67
i did it via the selection menu but i had the same problem

Please Log in or Create an account to join the conversation.

More
12 Jan 2020 17:25 #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 or Create an account to join the conversation.

More
12 Jan 2020 19:53 - 12 Jan 2020 19:53 #154716 by DC67
Hello
Here is config zip

File Attachment:

File Name: Fenja.zip
File Size:1,261 KB
Attachments:
Last edit: 12 Jan 2020 19:53 by DC67.

Please Log in or Create an account to join the conversation.

More
12 Jan 2020 20:41 #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.
The following user(s) said Thank You: DC67

Please Log in or Create an account to join the conversation.

More
12 Jan 2020 21:58 - 12 Jan 2020 22:01 #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:
$ 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
Last edit: 12 Jan 2020 22:01 by dgarrett.

Please Log in or Create an account to join the conversation.

More
12 Jan 2020 23:12 #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 or Create an account to join the conversation.

More
13 Jan 2020 15:44 #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 or Create an account to join the conversation.

Time to create page: 0.088 seconds
Powered by Kunena Forum