Page 1 of 1

Unable to write file... and then it can

Posted: Sat 14 Dec 2013 9:11 pm
by Adrian Hudson
Here's an unusual thing:

I noticed the program had set all zeroes for yesterday's high/lows so I looked in the diags folder and found this:

14/12/2013 08:40:00.909 : Writing today.ini, LastUpdateTime = 14/12/2013 08:40:00 raindaystart = 751.200012207031 rain counter = 753
14/12/2013 08:50:00.828 : Writing today.ini, LastUpdateTime = 14/12/2013 08:50:00 raindaystart = 751.200012207031 rain counter = 753
14/12/2013 09:00:00.176 : === Day reset, today = 14
14/12/2013 09:00:00.176 : === Day reset for 13/12/2013
14/12/2013 09:00:00.176 : NOAA reports will be uploaded at next web update
14/12/2013 09:00:00.180 : Raintotal = 753 Raindaystart = 751.200012207031
14/12/2013 09:00:00.180 : Rainyesterday (calibrated) set to 1.79998779296875
14/12/2013 09:00:00.180 : RainDayThreshold = -1
14/12/2013 09:00:00.180 : rdt1000=200 ry1000=1800
14/12/2013 09:00:00.180 : Yesterday was a rain day
14/12/2013 09:00:00.180 : Consecutive rain days = 2
14/12/2013 09:00:00.180 : Raindaystart set to 753
14/12/2013 09:00:00.183 : StartofdayET set to 619.760009765625
14/12/2013 09:00:00.293 : Error writing today.ini: Unable to write to C:\Cumulus\data\today.ini
14/12/2013 09:00:00.294 : Write yesterday file: Date = 14/12/2013
14/12/2013 09:00:00.294 : Error writing yesterday.ini: Unable to write to C:\Cumulus\data\yesterday.ini
14/12/2013 09:00:00.294 : Creating NOAA monthly report for month 12 year 2013
14/12/2013 09:00:00.393 : Saving monthly report as C:\Cumulus\Reports\NOAAMO1213.txt
14/12/2013 09:00:00.397 : Creating NOAA yearly report for year 2013
14/12/2013 09:00:01.419 : Saving yearly report as C:\Cumulus\Reports\NOAAYR2013.txt
14/12/2013 09:00:01.449 : Creating backup folder C:\Cumulus\backup\daily\20131214090000\
14/12/2013 09:00:01.458 : === Day reset complete
14/12/2013 09:00:01.458 : Now recording data for day=14 month=12 year=2013
14/12/2013 09:00:01.559 : Writing today.ini, LastUpdateTime = 14/12/2013 09:00:01 raindaystart = 753 rain counter = 753
14/12/2013 09:00:02.721 : Uploading NOAA reports
14/12/2013 09:10:00.756 : Writing today.ini, LastUpdateTime = 14/12/2013 09:10:00 raindaystart = 753 rain counter = 753
14/12/2013 09:20:00.506 : Writing today.ini, LastUpdateTime = 14/12/2013 09:20:00 raindaystart = 753 rain counter = 753
14/12/2013 09:30:00.995 : Writing today.ini, LastUpdateTime = 14/12/2013 09:30:00 raindaystart = 753 rain counter = 753
14/12/2013 09:40:00.644 : Writing today.ini, LastUpdateTime = 14/12/2013 09:40:00 raindaystart = 753 rain counter = 753

There is is, busily writing to today.ini. Then comes the end of day (at 09:00) and it fails writing both today.ini and yesterday.ini, then a little later it happily writes today.ini.

I have checked disk for errors... none. I can't think why it should do that. Has anyone seen anything like this before? Or has anyone got any ideas?

Re: Unable to write file... and then it can

Posted: Sat 14 Dec 2013 9:18 pm
by steve
The usual reason for being unable to write to a file is that something else is preventing write access to the file - antivirus etc. Windows would usually give an error code in the message which confirms this, or even say explicitly that another process has locked the file, but in this case it hasn't.

Re: Unable to write file... and then it can

Posted: Sat 14 Dec 2013 10:26 pm
by Adrian Hudson
Hi Steve, thanks for your reply. Its very odd. You must be right but I can't see what it must have been. Nothing in Windoze logs etc etc and Antivirus, which might have been the problem shouldn't ever lock a file.

Anyway, I guess yesterday.ini will sort itself out tomorrow but does it matter that today.ini was unable to be written? Will I lose anything or will it sort itself out too?

Adrian

Re: Unable to write file... and then it can

Posted: Sat 14 Dec 2013 11:10 pm
by steve
Adrian Hudson wrote:does it matter that today.ini was unable to be written?
Yes, because it should have been reset at the start of day, and presumably wasn't, so it will still have yesterday's highs and lows. So the entry that gets logged to dayfile.txt for today will potentially be a mix of yesterday's and today's highs and lows. I can't think of a better solution than stopping Cumulus and manually correcting the file so that it only has today's details.

Re: Unable to write file... and then it can

Posted: Sat 14 Dec 2013 11:16 pm
by Adrian Hudson
Thanks Steve... not looking forward to that much.

Re: Unable to write file... and then it can

Posted: Sat 14 Dec 2013 11:42 pm
by steve
Actually, it should be OK. It will have reset the variables internally, so the next time it wrote today.ini the file would be correct.

Re: Unable to write file... and then it can

Posted: Sat 14 Dec 2013 11:50 pm
by Adrian Hudson
You are, as usual, absolutely correct. I just checked the file and it looks fine.
Thanks again Steve.
Adrian