I'm looking for a small coding snack which i think should be easy for someone who has done something similar:
I want it to open a configuration file,
add one or more series of lines over time
and being able to work with these lines even though another program might have changed the same file at another point in time.
Addittionaly if the program would be able to add the same operations to a file on another computer (so i can take it home on a usb stick and save more time) that would be a bonus.
This means the program has to detect its own additions, but can't rely on looking at the top or bottom of the file.
I need this to setup dozens of development websites. Each of them needs a line in the HOSTS file. However other software adds lines to this file (for example anti-spyware tools). Fortunately HOSTS supports commenting by prefixing a line with #
If I could take my hosts-file-changes home and add them there too that would be ace. Then I can make changes whereever i like and add them to the other side with a few clicks.