David Hinz wrote:
> What is causing the following program to hang after it has
displayed all of the
> directory entries? I'm sure it has something to do with one of
the pipes being held open,
> but how do I keep that from happening? Is there a better way to
do reading and writing
> through a pipe to a process?
The -availableData method on NSFileHandle blocks when there is no
data to be read, waiting for the other side of the pipe to send
something more. Meanwhile, FTP is waiting for you to send another
command on the write side of the pipe. That's why you are hanging.
Probably the easiest thing to do is just to watch for the "226
Transfer complete." message from the FTP server and break out of the
loop after you have read it.
> BTW, I've seen a Java version of an ftp class, has anyone written
a objective-c
> version?
Our ftp session management and processing code is free to use, it's
in our OWF framework at:
ftp://ftp.omnigroup.com/pub/software/Source/Frameworks/OWF-1998-12-10.tar.gz
more information about our source license at:
http://www.omnigroup.com/DeveloperResources/
It is probably pretty heavy duty for what you are trying to do
though, unless the code you posted was just a beginning and you are
going to do quite a bit of ftp work.
Hope this helps,
--Greg
-----
Greg Titus
Omni Development Inc.
[EMAIL PROTECTED]