T'was a good thought, but not so

P:\>dir "<P:\test\.bak" The filename, directory name, or volume label syntax is incorrect.

As this shows, '<' is acting exactly the same way as '*'

P:\test>dir "<.<" Volume in drive P is Winnt Volume Serial Number is D822-5AE5 Directory of P:\test 19/09/03 13:29 <DIR> . 19/09/03 13:29 <DIR> .. 20/04/03 19:48 1,193 237671.pl8 20/04/03 19:28 729 242776.pl8 20/04/03 19:33 624 243366.pl8 21/04/03 03:13 456 250383.pl8 20/04/03 19:56 1,574 250495.pl8 ... P:\test>dir "2<.bak" Volume in drive P is Winnt Volume Serial Number is D822-5AE5 Directory of P:\test 27/08/03 00:47 608 286744.pl8.bak 28/08/03 20:20 801 287272.pl8.bak 31/08/03 12:42 729 287900-2.pl8.bak 31/08/03 09:58 1,056 287900.pl8.bak 05/09/03 15:37 2,015 289016-2.pl8.bak 05/09/03 09:56 1,092 289106.pl8.bak 05/09/03 17:26 1,165 289250.pl8.bak 7 File(s) 7,466 bytes 978,853,888 bytes free

This behaviour is completely undocumented in both the latest XP CMD docs and the online API docs for FindFirstFile/FindNextFile, which are also affected.

Even a fairly extensive google has failed to turn up any trace of it as either a bug or a feature, which amazes me even more. Could be that DaveH has found a completely new bug that affects Win32 going all the way back to something like 1995 and has gone undiscovered? Seems unlikely but...


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
If I understand your problem, I can solve it! Of course, the same can be said for you.


In reply to Re: Re: Re: Re: Re: Unexpected file test (-f) result on Windows by BrowserUk
in thread Unexpected file test (-f) result on Windows by DaveH

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.