Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Strawberry Perl on Windows 10 file test operators do not work as expected

by dasgar (Priest)
on Jul 22, 2020 at 22:11 UTC ( #11119683=note: print w/replies, xml ) Need Help??


in reply to Strawberry Perl on Windows 10 file test operators do not work as expected

It might be worth checking out testL from Win32::LongPath. It's not an exact syntax match to the -X tests, but it does provide an alternative method for those tests and provides support for any paths in Windows (including those that are longer than 255 characters in length and those using Unicode characters - both of which probably won't work with the -X tests).

If you find testL to be an acceptable alternative to the -X tests, one possible approach to get your code to work on Linux and Windows is to write subroutines to replace the -X tests and in those subroutines to check the OS type (Linux or Windows) to determine if it will use the -X tests (for Linux) or testL (for Windows). I'm not arguing that this is a "good" approach, but just wanted to toss out the one idea that I had on the topic.

  • Comment on Re: Strawberry Perl on Windows 10 file test operators do not work as expected

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11119683]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2021-01-27 06:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?