Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by BillKSmith (Monsignor)
on Oct 11, 2019 at 18:42 UTC ( [id://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

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.