2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
24 #include "NGTaskStream.h"
26 @implementation NGTaskStream
28 - (id)initWithPath:(NSString *)_executable
29 arguments:(NSArray *)_args
30 environment:(NSDictionary *)_env
42 return [self->task isRunning];
47 - (unsigned)readBytes:(void *)_buf count:(unsigned)_len {
50 - (unsigned)writeBytes:(const void *)_buf count:(unsigned)_len {
56 NSLog(@"tried to close already closed stream %@", self);
59 [self->task terminate];
63 - (NGStreamMode)mode {
64 return NGStreamMode_readWrite;
66 - (BOOL)isRootStream {
73 NSLog(@"WARNING: called mark on a stream which doesn't support marking !");
77 [[[NGStreamException alloc] initWithStream:self
78 reason:@"marking not supported"] raise];
81 - (BOOL)markSupported {
87 - (NSString *)description {
88 return [NSString stringWithFormat:
89 @"<%@[0x%08X] task=%@ mode=%@>",
90 NSStringFromClass([self class]), (unsigned)self,
92 [self modeDescription]];
95 @end /* NGTaskStream */