This is pipes.m in view mode; [Download] [Up]
#include <gnustep/base/StdioStream.h>
#include <Foundation/NSString.h>
int main()
{
char b[100];
int len;
id s = [[StdioStream alloc] initWithPipeFrom: @"cat /etc/group | sort"];
while ((len = [s readBytes:b length:99]) > 0)
{
b[len] = '\0';
printf("[%d]: %s\n", len, b);
}
exit(0);
}
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.