diff options
author | Urban Müller | 2010-11-11 16:11:39 +0000 |
---|---|---|
committer | Urban Müller | 2010-11-11 16:11:39 +0000 |
commit | 8874dd2a9b617c7f846fdbaf208e0c611f9aa23a (patch) | |
tree | 7ff3fcf098a894348a990b58c468d0d4e8b7a9de /it.class | |
parent | 4f5935eeb6112fbc086b32565066e31e9b72f111 (diff) | |
download | itools-8874dd2a9b617c7f846fdbaf208e0c611f9aa23a.tar.gz itools-8874dd2a9b617c7f846fdbaf208e0c611f9aa23a.tar.bz2 itools-8874dd2a9b617c7f846fdbaf208e0c611f9aa23a.zip |
early version of generic line processor
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -783,6 +783,16 @@ static function file_put($filename, $data, $p = array()) return ($out = fopen($filename == "-" ? "php://stdout" : $filename, "w")) && (fputs($out, $data) === strlen($data)) && fclose($out); } +function cat($fn) +{ + return new it_pipe(array('fn' => $fn)); +} + +function pipe($cmd, $args = array()) +{ + return new it_pipe(is_string($cmd) ? array('cmd' => $cmd, 'args' => $args) : array('data' => $cmd)); +} + } ?> |