# New Ticket Created by A. Sinan Unur
# Please include the string: [perl #130889]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=130889 >
This is on Windows 10 using MoarVM, NQP, and perl6 built using Visual
Studio 2015 tools. I am using development versions on this machine,
but I don't think the problem is caused by that.
Consider the following script:
$ type cogito-ergo-sum.pl6
use v6.c;
my $test-file = 'sartre'.IO;
my $test-fh = $test-file.open :w;
die "Could not open $test-file" unless ?$test-fh;
$test-fh.put: Q:to/END/;
Camus was right!
END
$test-fh.close;
($test-file ~ ($test-file.e ?? ' exists' !! ' does not exist' )).say;
die "$test-file does not exist" unless $test-file.e;
Here is what I see:
$ perl6 cogito-ergo-sum.pl6
sartre does not exist
sartre does not exist
in block <unit> at cogito-ergo-sum.pl6 line 15
But, of course, the file was created:
$ dir sartre
...
2017-02-28 09:34 AM 20 sartre
On the second run, when the file 'sartre' already exists, it can find it:
$ perl6 cogito-ergo-sum.pl6
sartre exists
This seems to be some kind of caching issue involving the file system,
but, of course, that could be wrong because I haven't examined what
actually happens.
-- Sinan