Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Text File Buffering problem
Message
From
13/11/2017 13:01:28
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
13/11/2017 12:24:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01655554
Message ID:
01655561
Views:
59
>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?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform