home *** CD-ROM | disk | FTP | other *** search
-
- #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
-