Two nits for the price of one:

On a *nix filesystem I want to open either File or FILE or throw an error if they both exist.

Do you really want to "throw an error" or do you mean "be alerted to the existence of two files with similar names?" The names may be similar, but the content need not be identical. (And -- not a nit; just curiousity: do you care about whether the two are in the same path?)

On Windows and Darwin this fails, as both files always exist, but are the same file.

At least on 'doze, IMO that's a misleading statement:

Only ONE such file exists, but because w32 is case-insensitive-but-case-preserving any attempt to create "FILE" in a particular \path\to\dir\ which already contains "File" will (for some aps) produce a (windows-rooted) warning "File already exists; overwrite?" or (windows-native) error message that "Duplicate name exists...".

Sidebar: At least some aps which automaticly create/overwrite a .bak file on save, will create (in the example above) the .bak as "FILE.bak" (case transformed to match the new name).


In reply to Re: Case insensitive Filesystems. by ww
in thread Case insensitive Filesystems. by gam3

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.