Skip to content

Commit

Permalink
[src/builtins/any-str.pir] implemented :l
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 29, 2009
1 parent 77bf8cf commit db84bc0
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 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,:s,index,rindex,substr', 'from'=>$P0)
'!EXPORT'('chomp,chars,:d,:e,:f,:l,:s,index,rindex,substr', 'from'=>$P0)
.end
Expand Down Expand Up @@ -145,6 +145,28 @@ file.
.return ($P0)
.end
=item ':l'()
our Bool multi Str::':l' ( Str $filename )
Returns whether the file with the name indicated by the invocant is a symbolic link.
=cut
.sub ':l' :method :multi(_)
.param int arg :optional
.param int has_arg :opt_flag
.local string filename
filename = self
.local pmc file
file = root_new ['parrot';'File']
$I0 = file.'is_link'(filename)
.return ($I0)
.end
=item ':s'()
our Int multi Str::':s' ( Str $filename )
Expand Down

0 comments on commit db84bc0

Please sign in to comment.