-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments are not kept after write_to_file #77
Comments
Yup.. Comments are not kept after parsed. Any PRs are welcome. |
cool, could you please suggest an implementation strategy? |
I have no idea how to implement that gracefully, because comments may not be followed by a key-value pairs, or a section header, how to store it? Do you know any other INI libraries that could kept comments after parsing? @lrascao |
I'm not familiar with rust-ini, but based on this issue alone, I assume it works by mapping the whole file on read, and flushing the whole structure into a file on write. Which will probably bite you when dealing with big files, so it may not be the best approach. From Bash I use crudini which is in Python so prolly not much of a help, but who knows. All I know is it works just fine with comments. Basically it doesn't care about irrelevant sections in the file, or irrelevant lines in the section either. It touches only the parts you tell it touch. |
after
write_to_file
is called we end up with:The text was updated successfully, but these errors were encountered: