Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- any-str.pir 2009-12-28 11:28:21.000000000 +0200
- +++ any-str.pir 2009-12-29 17:11:21.000000000 +0200
- @@ -23,7 +23,7 @@
- .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
- @@ -145,6 +145,28 @@
- .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 )
Add Comment
Please, Sign In to add comment