/[VRac]/Tape.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /Tape.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 194 by dpavlin, Sat Apr 12 22:54:19 2008 UTC revision 210 by dpavlin, Mon Apr 14 21:16:19 2008 UTC
# Line 100  sub write_tape { Line 100  sub write_tape {
100    
101  =head2 load_tape  =head2 load_tape
102    
103    $self->load_tape( '/path/to/file' );    $self->load_tape( '/path/to/file', $position );
104    
105  =cut  =cut
106    
107  sub load_tape {  sub load_tape {
108          my $self = shift;          my $self = shift;
109          my $path = shift || return;          my $path = shift || return;
110            my $pos = shift || 0;
111    
112          my $tape = read_file( $path ) || confess "can't load $path: $!";          my $tape = read_file( $path ) || confess "can't load $path: $!";
113          $self->tape_path( $path );          $self->tape_path( $path );
114    
115          $self->tape_pos( 0 );          $self->tape_pos( $pos );
116          $self->tape( $tape );          $self->tape( $tape );
117          warn "loaded tape $path ", -s $path, " bytes\n";          warn "loaded tape $path ", -s $path, " bytes at $pos\n";
118          return 1;          return 1;
119  }  }
120    

Legend:
Removed from v.194  
changed lines
  Added in v.210

  ViewVC Help
Powered by ViewVC 1.1.26