~dexter/parrot-pkg/maverick

« back to all changes in this revision

Viewing changes to runtime/parrot/library/osutils.pir

  • Committer: Piotr Roszatycki
  • Date: 2011-01-11 14:34:28 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: piotr.roszatycki@gmail.com-20110111143428-s7pa7qz38m61o4tw
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 2009-2010, Parrot Foundation.
2
 
# $Id: osutils.pir 49084 2010-09-17 15:19:32Z fperrad $
3
2
 
4
3
=head1 NAME
5
4
 
226
225
    say dst
227
226
  L1:
228
227
    $P0 = new 'FileHandle'
 
228
    $P0.'encoding'('binary')
229
229
    push_eh _handler1
230
230
    $S0 = $P0.'readall'(src)
231
231
    pop_eh
572
572
 
573
573
.sub 'slurp'
574
574
    .param string filename
 
575
    .param string encoding      :named('encoding') :optional
 
576
    .param int has_encoding     :opt_flag
575
577
    $P0 = new 'FileHandle'
 
578
    unless has_encoding goto L1
 
579
    $P0.'encoding'(encoding)
 
580
  L1:
576
581
    push_eh _handler
577
582
    $S0 = $P0.'readall'(filename)
578
583
    pop_eh
768
773
    .param string filename
769
774
    .local pmc fh, gh
770
775
    fh = new 'FileHandle'
 
776
    fh.'encoding'('binary')
771
777
    push_eh _handler1
772
778
    $S0 = fh.'readall'(filename)
773
779
    $I0 = length $S0