On 09/28/2017 09:53 PM, ToddAndMargo wrote:
On 09/28/2017 09:45 PM, Brandon Allbery wrote:
On Fri, Sep 29, 2017 at 12:41 AM, ToddAndMargo <toddandma...@zoho.com
<mailto:toddandma...@zoho.com>> wrote:
Does perl 6 have an equivalent to bash's "-f" to
see if a file exists? Or is that a system call?
IO::Path's .f method. (Or .e to not require it to be a file, etc. as
usual.)
pyanfar Z$ 6 '".profile".IO.f.say'
True
Hi Brandon,
How do I get this to give me a "False" instead of crashing
and wagging the finger at me?
$ perl6 -e 'say "eraseme.txt".IO.f;'
True
$ perl6 -e 'say "erasxeme.txt".IO.f;'
Failed to find '/home/linuxutil/erasxeme.txt' while trying to do '.f'
in block <unit> at -e line 1
Many thanks,
-T
Figured it out. The chat line told me that there is an error in the
docs. The proper way was "e" not "f"
$ perl6 -e 'my $x="eraseme.txt".IO.e;say $x'
True
$ perl6 -e 'my $x="erasemexxx.txt".IO.e;say $x'
False
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~