NSUnbufferedIO really line buffered?
NSUnbufferedIO really line buffered?
- Subject: NSUnbufferedIO really line buffered?
- From: Todd Heberlein <email@hidden>
- Date: Tue, 29 Oct 2002 21:05:16 -0800
I was using the Animal example in "Cocoa Programming" (pp 891-902) to
wrap an FTP task. It largely works; although there are two quirks I
cannot figure out. Here is one:
I set the buffering to NSUnbufferedIO per the instructions, and it
works except in one spot. The FTP generates output that does *not*
terminate the line. In particular, using a normal shell the user
prompt is shown:
Name (127.0.0.1:heberlei):
with the cursor left at the end of the line. The NSTask does not
immediately read this output. Once I blindly send my account name, I
get the "331" FTP response, but it is appended to the account name
prompt line:
Name (127.0.0.1:heberlei): 331 Password required for heberlei.
This isn't a huge problem, but it is annoying. I did a "man setbuf",
and it mentioned three buffering modes: unbuffered, block buffered, and
line buffered. My feeling is that the behavior I am getting is
actually "line buffered" and not truly "unbuffered".
Does anyone know if this is the case? Is there a way around this?
Thanks,
Todd
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.