On 03/21/2017 04:27 AM, Philip Hazelden wrote:
$PathAndName.IO.f or $PathAndName.IO.open(:w).close;
Note, the following sequence is possible:
1. .IO.f returns false
2. Someone creates the file and writes some data to it
3. .IO.open truncates the file
Thus, this has a chance of editing the
> $PathAndName.IO.f or $PathAndName.IO.open(:w).close;
Note, the following sequence is possible:
1. .IO.f returns false
2. Someone creates the file and writes some data to it
3. .IO.open truncates the file
Thus, this has a chance of editing the file.
I suggest instead (untested):
On 03/21/2017 04:02 AM, Simon Proctor wrote:
It's a logical test but I'd probably use || instead.
Thank you!
It's a logical test but I'd probably use || instead.
See : https://docs.perl6.org/language/traps#Loose_boolean_operators
On Tue, 21 Mar 2017 at 10:56 ToddAndMargo wrote:
> On 03/21/2017 03:07 AM, Brent Laabs wrote:
> > $PathAndName.IO.f or
On 03/21/2017 03:07 AM, Brent Laabs wrote:
$PathAndName.IO.f or $PathAndName.IO.open(:w).close;
Is that a coding "or" or an English "or"?
--
~~
Computers are like air conditioners.
They malfunction when you open windows
On 03/21/2017 03:50 AM, Simon Proctor wrote:
.e checks a path exists.
.f checks it exists AND is a file.
.d checks it exists AND is a directory.
(Perl 5 was the -e, -f and -d tests)
Beautiful explanation! Thank you!
Perl 5 has the (about) same test as bash and I write
a lot in that too. (I
.e checks a path exists.
.f checks it exists AND is a file.
.d checks it exists AND is a directory.
(Perl 5 was the -e, -f and -d tests)
On Tue, 21 Mar 2017 at 10:19 ToddAndMargo wrote:
> On 03/21/2017 03:07 AM, Brent Laabs wrote:
> > You can create a file by opening a
On Tue, Mar 21, 2017 at 3:01 AM, ToddAndMargo > wrote:
Hi All,
How to I do this bash code in Perl 6?
if [ ! -f "$PathAndName" ]; then touch "$PathAndName" fi
I am not finding the directions on how to create a "new"
file
You can create a file by opening a filehandle for writing.
$PathAndName.IO.f or $PathAndName.IO.open(:w).close;
On Tue, Mar 21, 2017 at 3:01 AM, ToddAndMargo wrote:
> Hi All,
>
> How to I do this bash code in Perl 6?
>
> if [ ! -f "$PathAndName" ]; then touch
Hi All,
How to I do this bash code in Perl 6?
if [ ! -f "$PathAndName" ]; then touch "$PathAndName" fi
I am not finding the directions on how to create a "new"
file at a specific location.
Many thanks,
-T
--
~~
Computers are like air conditioners.
They
10 matches
Mail list logo