* * *

Author Topic: No Flush () for Handle based I/O?  (Read 598 times)

joho

  • Jr. Member
  • **
  • Posts: 69
  • Joaquim Homrighausen
    • ~/JoHo
No Flush () for Handle based I/O?
« on: September 03, 2017, 08:27:35 am »
Is there no FileCommit (fh : THandle) or similar? Like Flush (). AFAIK, all OSs have this functionality.

Thaddy

  • Hero Member
  • *****
  • Posts: 4617
Re: No Flush () for Handle based I/O?
« Reply #1 on: September 03, 2017, 09:05:28 am »
Manuals...???

https://www.freepascal.org/docs-html/rtl/system/flush.html for text files.

Under Windows we have https://msdn.microsoft.com/en-us/library/windows/desktop/aa364439(v=vs.85).aspx which can be used with the handle of a stream.

[edit]
I am rather surprised that the baseunix unit does not implement fp equivalents of flush(), fflush() fsync() and sync()... Maybe Marco can have a look at it?
« Last Edit: September 03, 2017, 10:19:32 am by Thaddy »
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

joho

  • Jr. Member
  • **
  • Posts: 69
  • Joaquim Homrighausen
    • ~/JoHo
Re: No Flush () for Handle based I/O?
« Reply #2 on: September 03, 2017, 11:43:44 am »
My point was exactly that. I know about Flush (), but it does not take a THandle, like FileClose, FileWrite, FileRead, and so on.

So my point is that there should be a FileFlush (const fh: THandle).

(And there should also be a FileCreateNew () that will fail if the file exists :) )

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5804

joho

  • Jr. Member
  • **
  • Posts: 69
  • Joaquim Homrighausen
    • ~/JoHo
Re: No Flush () for Handle based I/O?
« Reply #4 on: September 04, 2017, 08:46:36 am »
Great ... I'm not too familiar with release statuses, etc for FP. When will this be in a Stable release?

Thaddy

  • Hero Member
  • *****
  • Posts: 4617
Re: No Flush () for Handle based I/O?
« Reply #5 on: September 04, 2017, 09:46:25 am »
Tnx Marco!
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5804
Re: No Flush () for Handle based I/O?
« Reply #6 on: September 04, 2017, 10:03:08 am »
Hopefully soon, but it is too early to tell.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus