mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
18 lines
312 B
Mathematica
18 lines
312 B
Mathematica
|
#include <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);
|
||
|
}
|