Hey folks!
I have about 80 files that are processed by the above code. In some instances, "tempfile.txt" does not get renamed to "LineData[counter].storefilename".Code:if(!found) { strcpy(LineData[counter2].filename2, LineData[counter].storefilename); rewind(p_openfile); insertstring(); counter2++; fclose(p_openfile); remove(LineData[counter].storefilename); rename("tempfile.txt", LineData[counter].storefilename); }
I can verify that "tempfile.txt" exists, the file "LineData[counter].storefilename" has been deleted, and that "LineData[counter].storefilename" is a valid filename in the structure, using a debugger. So why does rename not work in all instances when it is called?
Thanks in advance.