You expect open to identify and reject all invalid names.
What I actually said in my OP was:
[...] before this I trusted the open to tell me if there was a problem with creating an output file.
In this case with a colon in the filename, a file was created successfully and output was correctly written to the Alternate Data Stream as the other monks demonstrated to me. I bet I'm not the only one who had never heard of this newer feature of Windows. I was surprised and curious about this. My current script doesn't really need to completely validate the filenames since the names are not from user inputs. However I have coworkers who sometimes make clumsy changes so I try to make things bulletproof.
Have you seen cases where the open() function did not correctly identify and reject invalid names?
|Replies are listed 'Best First'.|
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
by Lotus1 (Vicar) on Oct 11, 2019 at 20:48 UTC