Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Release 1.0
[palacios.git] / misc / test_vm / scripts / pcat
diff --git a/misc/test_vm/scripts/pcat b/misc/test_vm/scripts/pcat
new file mode 100755 (executable)
index 0000000..d58f9fd
--- /dev/null
@@ -0,0 +1,23 @@
+#! /usr/bin/perl
+
+# A version of cat written in perl.
+
+use strict qw(refs vars);
+use FileHandle;
+
+binmode STDOUT;
+
+my $buf = chr(0) x 1024;
+
+my $file;
+while ( ($file = shift @ARGV) ) {
+    my $fh = new FileHandle("<$file");
+    (defined $fh) || die "Couldn't open $file: $!\n";
+    binmode $fh;
+
+    my $n;
+    while ( ($n = sysread($fh, $buf, 1024)) > 0 ) {
+       syswrite( STDOUT, $buf, $n );
+    }
+    $fh->close();
+}