summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorUrban Müller2010-11-11 16:11:39 +0000
committerUrban Müller2010-11-11 16:11:39 +0000
commit8874dd2a9b617c7f846fdbaf208e0c611f9aa23a (patch)
tree7ff3fcf098a894348a990b58c468d0d4e8b7a9de /it.class
parent4f5935eeb6112fbc086b32565066e31e9b72f111 (diff)
downloaditools-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.class10
1 files changed, 10 insertions, 0 deletions
diff --git a/it.class b/it.class
index 26f9dd7..f8c8553 100644
--- a/it.class
+++ b/it.class
@@ -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));
+}
+
}
?>