Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Suggestion: Add Flush() capability to file.


  • Please log in to reply
1 reply to this topic
Steve Waring
  • Members
  • 4 posts
  • Last active: Jun 04 2017 08:02 AM
  • Joined: 27 May 2015

If a long running script is producing a log file of it's actions, it can close the log each time it writes to it and then open it for append. Or it can just keep the file open.

 

The first method is slow. The second method does not allow the file to be followed in real time.

 

If a flush() method was added to the File object, when the script reached points where it might be useful for an observer to see activity in the log, the flush() method could be used to write out what is in the buffers.



Steve Waring
  • Members
  • 4 posts
  • Last active: Jun 04 2017 08:02 AM
  • Joined: 27 May 2015

Ignore this, I have just realised that file.__Handle flushes the output buffers  :p