Thanks for the additional information regarding this. It doesn't affect me personally (either at work or home) at the moment, and probably won't do in the forseeable future; however, for those working with the MSWin filesystem, this could be important.

I suppose the real issue is how this might affect telldir in the context of the code I posted. I'm not in a position to test this but I'll attempt to paraphrase in *nix parlance. Given a truly empty directory (root or otherwise), e.g.

$ ls -al fred ls: cannot access 'fred': No such file or directory $ mkdir fred $

Where a listing showed

$ ls -al fred total 0 $

instead of

$ ls -al fred total 0 drwxr-xr-x 2 ken staff 68 Jan 31 12:57 . drwxr-xr-x 18 ken staff 612 Jan 31 12:57 .. $

How would the "eh" handle be reported? Just to be clear, that's the one I showed as:

eh is a dirhandle       # eh = dirhandle to "pm_1208018_test_dir_empty"

If someone could test that and report their findings, it could provide useful information to anyone wanting to use this technique in the future.

— Ken


In reply to Re^3: Testing for a directory handle by kcott
in thread Testing for a directory handle by ns550

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.