This is UNIXobject.m in view mode; [Download] [Up]
#import "UNIXobject.h" #import <streams/streams.h> #import <dpsclient/dpsclient.h> #import <stdio.h> @implementation UNIXobject - execute:(char *)theCommand { NXStream *theStream; FILE *fp; fp=popen(theCommand,"r"); theStream=NXOpenFile(fileno(fp),NX_READONLY); if (delegate && [delegate respondsTo:@selector(returnOutput:)]) [delegate perform:@selector(returnOutput:) with:(void *)theStream]; NXClose(theStream); pclose(fp); return self; } - setDelegate:anObject { delegate=anObject; return self; } - delegate { return delegate; } @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.