I've been trying to write this simple AIR application for a client but I'm stumbling on storing certain settings persistently (shared object is not an option). It's been requested that I use INI files which I'm quite comfortable with. The problem is that in writing my INI editing class I came across an issue. Standard INI files use a syntax similar to the following:
I've written a working get function to retrieve the value of any key in any section in the file, but I can not get my set function to work properly because what I'd like to do is just overwrite the rest of the line from the right of the equal sign for any key I'd like to change. The problem is that the FileStream.position member works by counting bytes from the start of the file, unlike other languages where you can set a line number to be start writing on.Code:[user settings] moviedir=C:\Users\Public\Videos imagedir=C:\Users\Public\Images
Also, I cannot simply search the contents of the file and return the position of the key and use that in place of the position member because different sections of the INI file have similar keys. Does anyone know of a way I might be able to overwrite just the portion to the right of the equal sign (or the whole line) or a way to get the starting byte index of the line itself without having to delete/rewrite the whole file?