discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSPipe and NSFileHandle.


From: Marko Riedel
Subject: NSPipe and NSFileHandle.
Date: Wed, 25 Jun 2003 14:28:16 +0200 (CEST)

Hi there,

here is  an excerpt from NSPipe.m (+pipe)

if (pipe(p) == 0)
{
  readHandle = [[NSFileHandle alloc] initWithFileDescriptor: p[0]]; 
  writeHandle = [[NSFileHandle alloc] initWithFileDescriptor: p[1]];
}

So far, so good. Here is the method from  NSFileHandle.m that is
invoked. 

- (id) initWithFileDescriptor: (int)desc
{
  return [self initWithFileDescriptor: desc closeOnDealloc: NO];
}

This means that you run out of file descriptors if you open a lot of
pipes. The descriptors are not being released when the pipe is
deallocated.

Is this a bug or a feature? I found that I had to close the
descriptors manually, i.e. by using close (2) and -fileDescriptor.

Best regards, 


-- 
+------------------------------------------------------------+
| Marko Riedel, EDV Neue Arbeit gGmbH, mriedel@neuearbeit.de |
| http://www.geocities.com/markoriedelde/index.html          |
+------------------------------------------------------------+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]