home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Updates / Perl / Non-RPC / !Perl / scripts / chunklist < prev    next >
Text File  |  1998-07-14  |  603b  |  34 lines

  1. #!perl -w
  2. # Version 0.01
  3. use strict;
  4. use RISCOS::Chunkfile;
  5. use RISCOS::File 'globlist';
  6. use RISCOS::Filespec;
  7.  
  8. use vars qw($VERSION);
  9.  
  10. $VERSION = 0.01;
  11.  
  12. sub do_file
  13. {
  14.     my $file = shift;
  15.     my $chunks = new RISCOS::Chunkfile shift;
  16.     # So that name and data source can differ
  17.  
  18.     unless ($chunks) {
  19.     warn "'$file' is not a chunkfile";
  20.     }
  21.     else
  22.     {
  23.         foreach my $chunk (@{$chunks->Chunks}) {
  24.             printf "%-3d %8s  at &%06X  %d\n",
  25.               $chunk->Index, $chunk->ID, $chunk->Offset, $chunk->Length;
  26.         }
  27.     }
  28. }
  29.  
  30. foreach (globlist(@ARGV))
  31. {
  32.     do_file ($_, $_);
  33. }
  34.