Re: I need help with .IO.d.Bool

[email protected] (ToddAndMargo via perl6-users) Wed, 2 Apr 2025 20:39:51 -0700
Newsgroups perl.perl6.users
Message-ID <[email protected]>
On 4/2/25 6:08 PM, Bruce Gray wrote:
> 
> 
>> On Apr 2, 2025, at 19:47, ToddAndMargo via perl6-users <[email protected]> wrote:
> 
> --snip--
> 
>>    raku -e "say '\\192.168.240.10\oldserver\Backup\MyDocsBackup\backup1'.IO.d.Bool;"
>>    False
> 
> --snip--
> 
> Moving this one-liner into a .raku file (to remove the complication of Windows needing double-quotes for our `-e`), and removing `.IO.d.Bool`, I ran just this line:
> 	say '\\192.168.240.10\oldserver\Backup\MyDocsBackup\backup1';
> The output is:
> 		\192.168.240.10\oldserver\Backup\MyDocsBackup\backup1
> So, the initial two backslashes are becoming a single backslash.
> You need a quoting that does not special-case doubled backslashes (like the Q[] I have seen you use), or to enter the path with initial quadruple backslashes.
> 
> Does changing your one-liner to this:
> 	raku -e "say Q[\\192.168.240.10\oldserver\Backup\MyDocsBackup\backup1].IO.d.Bool;"
 > fix the problem?

Yes.

raku -e "say 
Q[\\192.168.240.10\oldserver\Backup\MyDocsBackup\backup1].IO.d.Bool;"
True

raku -e "say 
Q[\\192.168.240.10\oldserver\Backup\MyDocsBackup\backup10].IO.d.Bool;"
False

Now how do I encode a variable inside a Q[]?



> If not, remove the `.Bool` just for a test run. You might still get False (like if the path exists but is not a directory), or you might get a Exception that gives you more detail of what is going wrong (like `Failed to find ...`, with the exact path that it was *actually* looking for).
>