Guest User

Untitled

a guest
Jul 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. --- any-str.pir 2009-12-28 11:28:21.000000000 +0200
  2. +++ any-str.pir 2009-12-29 17:11:21.000000000 +0200
  3. @@ -23,7 +23,7 @@
  4. .namespace []
  5. .sub 'onload' :anon :init :load
  6. $P0 = get_hll_namespace ['Any']
  7. - '!EXPORT'('chomp,chars,:d,:e,:f,:s,index,rindex,substr', 'from'=>$P0)
  8. + '!EXPORT'('chomp,chars,:d,:e,:f,:l,:s,index,rindex,substr', 'from'=>$P0)
  9. .end
  10.  
  11.  
  12. @@ -145,6 +145,28 @@
  13. .return ($P0)
  14. .end
  15.  
  16. +=item ':l'()
  17. +
  18. + our Bool multi Str::':l' ( Str $filename )
  19. +
  20. +Returns whether the file with the name indicated by the invocant is a symbolic link.
  21. +
  22. +=cut
  23. +
  24. +.sub ':l' :method :multi(_)
  25. + .param int arg :optional
  26. + .param int has_arg :opt_flag
  27. +
  28. + .local string filename
  29. + filename = self
  30. +
  31. + .local pmc file
  32. + file = root_new ['parrot';'File']
  33. +
  34. + $I0 = file.'is_link'(filename)
  35. + .return ($I0)
  36. +.end
  37. +
  38. =item ':s'()
  39.  
  40. our Int multi Str::':s' ( Str $filename )
Add Comment
Please, Sign In to add comment