Recent

Author Topic: No Flush () for Handle based I/O?  (Read 3971 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: 14373
  • Sensorship about opinions does not belong here.
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 »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

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

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.

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: 14373
  • Sensorship about opinions does not belong here.
Re: No Flush () for Handle based I/O?
« Reply #5 on: September 04, 2017, 09:46:25 am »
Tnx Marco!
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.
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.

 

TinyPortal © 2005-2018