diff --git a/src/builtins/any-str.pir b/src/builtins/any-str.pir index 1433b1ecb9a..2bd9b3d2f82 100644 --- a/src/builtins/any-str.pir +++ b/src/builtins/any-str.pir @@ -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 @@ -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