libs-base/Testing/pipes.m
mccallum 114bd3f3d6 (main): Use NSString in -initWithPipeFrom argument.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@867 72102866-910b-0410-8b05-ffd578937521
1996-01-26 23:41:59 +00:00

16 lines
282 B
Objective-C

#include <objects/StdioStream.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);
}