2

I am reading piped output from a console application via an NSFileHandle in Cocoa. How can I flush the stream associated to that file handle. If I could get a FILE* object from the NSFileHandle I could call fflush(). Is there a way around this?

Duncan
  • 443
  • 1
  • 5
  • 12
  • You could try `fdopen()` followed by `fflush()` but I’m not sure pipes need to be flushed. –  Sep 23 '11 at 18:06

1 Answers1

6

I believe the equivalent in NSFileHandle is -synchronizeFile.

Pang
  • 9,564
  • 146
  • 81
  • 122
loghound
  • 676
  • 6
  • 12