develooper Front page | perl.perl6.users | Postings from October 2023

Raku IO IceDrive bug

Thread Next
ToddAndMargo via perl6-users
October 10, 2023 00:43
Raku IO IceDrive bug
Message ID:
Hi All,

Windows 10 22H2
Windows 11 22H2

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

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 )  {
    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.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About