Overwritting a .dat file with saveBytes().
in
Programming Questions
•
3 years ago
Hello all,
I am in a bit of a jam and could really use some help. I have a piece of code that saves out some bytes to a .dat file using the saveBytes() command. It overwrites the previous bytes with new ones every 5 minutes. The program works like a charm on a Mac enviroment with no problems. However, on Windows 7 there is an issue. Basically, the program can't seem to save over the .dat file with the new information. It does manage to save the file once, but then can't save over it. It gives the following error:
Could not rename temporary file
C:Udigital_arts_19DocumentsProcessingyou_want_final umbers.dat8714842549421397589.tmp
The program then proceeds to leave the .tmp file and moves on. When the saver() fucntion tries to save again it does it again, creating a new .tmp file.
Below is the saver function I wrote:
void saver() {
byte a, b, c, d, e, f, g;
int[] test = {leta, letb, letc, letd, lete, letf, letg};
a = byte(test[0]);
b = byte(test[1]);
c = byte(test[2]);
d = byte(test[3]);
e = byte(test[4]);
f = byte(test[5]);
g = byte(test[6]);
byte[] nums = {a, b, c, d, e, f, g};
byte a, b, c, d, e, f, g;
int[] test = {leta, letb, letc, letd, lete, letf, letg};
a = byte(test[0]);
b = byte(test[1]);
c = byte(test[2]);
d = byte(test[3]);
e = byte(test[4]);
f = byte(test[5]);
g = byte(test[6]);
byte[] nums = {a, b, c, d, e, f, g};
saveBytes("numbers.dat", nums);
nums = null;
test = null;
}
nums = null;
test = null;
}
Like I said, this code works fine on a Mac. Any help would help a GREAT deal.
Thanks.
1