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.


fixed makefile to turn off vga
[palacios-OLD.git] / geekos / scripts / numsecs
1 #! /usr/bin/perl
2
3 # Find the number of 512-byte sectors needed to store
4 # given file.
5
6 # $Revision: 1.1 $
7
8 use strict qw(refs vars);
9
10 if ( scalar(@ARGV) != 1 ) {
11     print STDERR "Usage: numsecs <filename>\n";
12     exit 1;
13 }
14
15 my $filename = shift @ARGV;
16 my $size = (-s $filename );
17 die "Couldn't get size of $filename: $!" if ( !defined $size );
18
19 my $result = int($size / 512);
20 my $remainder = $size % 512;
21 $result++ if ( $remainder > 0 );
22
23 print "$result\n";