• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSUnbufferedIO really line buffered?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: (newbie)cocoa and darwin 6.0....
  • Next by Date: Wanna make a Creature?
  • Previous by thread: How do I tie an NSStepper to an NSDateFormatter?
  • Next by thread: Wanna make a Creature?
  • Index(es):
    • Date
    • Thread