>Hi all,
>
>I should know this solution, but I can not seem to solve it.
>
>In a my code I have a point where a file is read in a variable (FileToStr). The string is modified and then written back to the file (StrToFile). This is done multiple time, very quickly. The problem is that file content that is read is not the file previous written, but the one prior to the writing. It appears that it is reading from the file, but writing to a staging buffer before actually writing to the disk. Therefore the reading does not see the recent changes.
I had a case last week, on a server (a W2012 or later), when I'd upload via ftp (or whatever comm software - perhaps TS or TeamViewer) several versions of the same .prg from home, only to find that these changes were gone, that whenever I open it it's the version as of an hour ago. Not anywhere in the special capricious folders. When I look it up in the folder where I put it, it has the latest datetime, same as over here.
Then I remembered I had that case a few times over the last couple of years, which I solved by zipping it under a different name each time - it seems that unzipping is one of the operations that don't get reverted. Likewise, editing from VFP is also trusted, so I eventually retyped all the differences, compiled and ran the prg.
It's one of those that seemed like a good idea at the time, and we end up losing nerves while fighting the uphill battle.
If you feel like wasting more time on this... how about setting the timer and comparing the content of the variable from which you strfiled() it against a fresh filetostr(), just to see how long it takes for it to revert?