Skip to content

Commit

Permalink
[src/builtins/any-str.pir] implemented :s
Browse files Browse the repository at this point in the history
Patch courtesy of Heikki Mehtänen (hejki++).
  • Loading branch information
Carl Masak committed Dec 27, 2009
1 parent 8dc1895 commit 77bf8cf
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/builtins/any-str.pir
Expand Up @@ -23,7 +23,7 @@ the size of that file down and to emphasize their generic,
.namespace []
.sub 'onload' :anon :init :load
$P0 = get_hll_namespace ['Any']
'!EXPORT'('chomp,chars,:d,:e,:f,index,rindex,substr', 'from'=>$P0)
'!EXPORT'('chomp,chars,:d,:e,:f,:s,index,rindex,substr', 'from'=>$P0)
.end
Expand Down Expand Up @@ -145,6 +145,25 @@ file.
.return ($P0)
.end
=item ':s'()
our Int multi Str::':s' ( Str $filename )
Returns file size.
=cut
.sub ':s' :method :multi(_)
.param int arg :optional
.param int has_arg :opt_flag
.local string filename
filename = self
$I0 = stat filename, 1
.return ($I0)
.end
=item index()
=cut
Expand Down

0 comments on commit 77bf8cf

Please sign in to comment.