Raku IO IceDrive bug

[email protected] (ToddAndMargo via perl6-users)
Newsgroups perl.perl6.users
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.