Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Text File Buffering problem
Message
From
13/11/2017 13:56:33
 
 
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:
01655567
Views:
44
>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.
>
>Does anyone have any suggestions? Perhaps flush the buffer?
>Or I should use low-level file functions? Or would that add a performance hit?

Just a stab in the dark - have you tried putting a DOEVENTS just after writing the to see if that makes a difference?
Previous
Reply
Map
View

Click here to load this message in the networking platform