develooper Front page | perl.perl6.users | Postings from April 2025

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

Thread Previous | Thread Next
From:
Bruce Gray
Date:
April 6, 2025 00:14
Subject:
Re: I need help with .IO.d.Bool
Message ID:
[email protected]


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

-- 
Hope this helps,
Bruce Gray (Util of PerlMonks)


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at [email protected] | Group listing | About