Front page | perl.perl6.users |
Postings from October 2023
Raku IO IceDrive bug
Thread Next
From:
ToddAndMargo via perl6-users
Date:
October 10, 2023 00:43
Subject:
Raku IO IceDrive bug
Message ID:
a776996f-de74-4783-bade-de57b4140d66@zoho.com
Hi All,
Windows 10 22H2
Windows 11 22H2
RakudoMoar-2023.09.01-win-x86_64-msvc.msi
https://github.com/AntonOks/rakudo-star-win/releases
Note: zef requires git
An IO bug with Windows Ice Drive to report. (I
no longer report them the the bug reporter as I
have zero luck.)
Ice Drive is a cloud storage service that allows
you to use a local drive letter in Windows.
A free account is available from
https://icedrive.net/apps/desktop-laptop
The following will only open a blank file,
regardless of what you then write to it.
The second time you run your program and
the file already exists, it will work properly:
if not FileExists( $WanIpFileName ) {
$WanIpFileName.IO.open(:w);
spurt "$WanIpFileName", "New File Opened";
}
Then if you write to the file, nothing goes
into the file. But when you run the program
a second time, all is well. Note that the
blank file already exists the second time through.
The work around:
I wrote the following sub to deal with Raku
not being able to handle quotes properly
when trying to run a windows helper program.
my $PathIAm = $?FILE;
$PathIAm ~~ s:global| '/' |\\|;
sub RunCmd( Str $CommandStr, Bool $EchoOff = False ) {
my Str $BatFile = $PathIAm ~ ".bat";
my Str $RtnStr;
my Str $CmdStr = "";
if $EchoOff { $CmdStr = Q[@echo off] ~ "\n"; }
$CmdStr = $CmdStr ~ $CommandStr ~ "\n";
# print "$CmdStr\n";
spurt( $BatFile, $CmdStr );
$RtnStr = qqx { $BatFile };
# print "$RtnStr\n";
}
RunCmd Q[echo New File Opened > ] ~ $WanIpFileName;
And happy camping returns. I can write anything
I want to the file after that and it takes.
-T
Thread Next
-
Raku IO IceDrive bug
by ToddAndMargo via perl6-users