Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Why are there no errors when opening a filename that contains colons on Win10

by BillKSmith (Prior)
on Oct 11, 2019 at 18:42 UTC ( #11107348=note: print w/replies, xml ) Need Help??


in reply to Re^2: Why are there no errors when opening a filename that contains colons on Win10
in thread Why are there no errors when opening a filename that contains colons on Win10

Four of your ten test cases were valid filenames which opened correctly. Five of the six invalid names correctly failed to open. For the sixth invalid name, windows took the strange corrective action you describe as a 'feature'. I do not have a clue what makes this name special. We have no idea how other invalid names may be handled. Code which makes any assumptions about invalid names is simply not 'bullet-proof'. Your simple test probably finds enough errors to be useful. You may even consider it an advantage that it allows some special cases that are not strictly valid.
Bill
  • Comment on Re^3: Why are there no errors when opening a filename that contains colons on Win10

Replies are listed 'Best First'.
Re^4: Why are there no errors when opening a filename that contains colons on Win10
by Lotus1 (Vicar) on Oct 11, 2019 at 20:48 UTC

    The term 'bullet proof' can be relative. Compared to some of my co-workers who write scripts that read, write, copy, and move files blindly to UNC folders and drives that are sometimes full my scripts are very resilient and bullet proof.

    Thanks for your help.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2021-03-08 21:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (128 votes). Check out past polls.

    Notices?