Hi,
I am using INIOPEN to save and load some simple files that hold persistent data. Although not documented as such, I noted in the examples and other code on the forums that using INIOPEN "" after you've done your last INIPUT writes that file to disk, seemingly by calling a 'null file' to open.
However, when I call the save function next, I get the following error in the debug console on opening my file:
fopen("/var/mobile/Applications/<etc>/Documents/file.dat", "rb") failed
and when I next call INIOPEN "" at the end of the function, I get:
request: fopen("", "rb") failed
To clarify, there are two seperate files I am saving to, and I have to assume that they may have made changes and saved to the preferences file before I am next able to call the save file, so I can't just 'leave it open', as such.
I know that I could use OPENFILE and then explicitly call CLOSEFILE, but it seems so, so much easier for my purposes to use INIOPEN because it does all the hard work of formatting it in a readable format. To further clarify, apart from these debug messages, what I'm trying to do works just fine!
1) are these considered 'just for info' messages? And I don't mean just by you guys! What I mean is, would Apple reject it as a bug?
2) Is there any way round it? Am I ordering something wrong? Is there a way to explicitly TEST if a particular file opened for writing with INIOPEN is *still* open and therefore not make the duplicate call?
Thanks in advance for any wisdom or advice you can impart
I am using INIOPEN to save and load some simple files that hold persistent data. Although not documented as such, I noted in the examples and other code on the forums that using INIOPEN "" after you've done your last INIPUT writes that file to disk, seemingly by calling a 'null file' to open.
However, when I call the save function next, I get the following error in the debug console on opening my file:
fopen("/var/mobile/Applications/<etc>/Documents/file.dat", "rb") failed
and when I next call INIOPEN "" at the end of the function, I get:
request: fopen("", "rb") failed
To clarify, there are two seperate files I am saving to, and I have to assume that they may have made changes and saved to the preferences file before I am next able to call the save file, so I can't just 'leave it open', as such.
I know that I could use OPENFILE and then explicitly call CLOSEFILE, but it seems so, so much easier for my purposes to use INIOPEN because it does all the hard work of formatting it in a readable format. To further clarify, apart from these debug messages, what I'm trying to do works just fine!
1) are these considered 'just for info' messages? And I don't mean just by you guys! What I mean is, would Apple reject it as a bug?
2) Is there any way round it? Am I ordering something wrong? Is there a way to explicitly TEST if a particular file opened for writing with INIOPEN is *still* open and therefore not make the duplicate call?
Thanks in advance for any wisdom or advice you can impart