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.


moved host OS interfaces to a separate directory palacios/src/interfaces and palacios...
[palacios.git] / geekos / scripts / pcat
1 #! /usr/bin/perl
2
3 # A version of cat written in perl.
4
5 use strict qw(refs vars);
6 use FileHandle;
7
8 binmode STDOUT;
9
10 my $buf = chr(0) x 1024;
11
12 my $file;
13 while ( ($file = shift @ARGV) ) {
14     my $fh = new FileHandle("<$file");
15     (defined $fh) || die "Couldn't open $file: $!\n";
16     binmode $fh;
17
18     my $n;
19     while ( ($n = sysread($fh, $buf, 1024)) > 0 ) {
20         syswrite( STDOUT, $buf, $n );
21     }
22     $fh->close();
23 }