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?
Asked
Active
Viewed 1,490 times
2
-
You could try `fdopen()` followed by `fflush()` but Iām not sure pipes need to be flushed. ā Sep 23 '11 at 18:06
1 Answers
6
I believe the equivalent in NSFileHandle
is -synchronizeFile
.
-
3This results in an operation-not-supported exception if the underlying file handle is an NSPipe. ā Eric apRhys Mar 29 '15 at 02:02
-
@EricapRhys is there an alternative solution to `synchronizeFile` for this case? ā Aaron Ash Oct 05 '16 at 14:21