Alex Kost <[email protected]>: > Ah, thanks! I get it. But I also want to check an exit status of the > running command (sorry, that I didn't mention it). So I would like to > have the following procedure: > > (define (system-no-output* . args) > "Like 'system*' but suppress the output of the command indicated by ARGS." > ???) > > Or even better (it would be a perfect solution for me) the following macro: > > (define-syntax-rule (with-no-process-output body ...) > "Run BODY and suppress all output of the executed sub-processes." > ???)
Replace (close-input-port) with (close-pipe); that should give you the exit status. Also you don't need to copy the data to a dummy port if you only want to ignore it. > and there would be no standard/error output from both "ls" calls. Is > it possible? The diagnostic output (stderr) is a different story. You want to be sure to want to ignore it. To implement that properly, you should go lower-level with operating system calls (fork, exec, waitpid). Simply open "/dev/null" for writing and dup the file descriptor into the slots 1 and 2 of the child process. Marko
