Case Sensitivity in Windows 2000 Filenames?

Discussion in 'C++' started by orljustin, Jun 24, 2005.

  1. orljustin

    orljustin Guest


    I'm trying to check the existance of a file in Windows 2000 by opneing
    am fstream and seeing if it is open.

    However, it seems that the executable doesn't care about case.

    ie, if I am checking on myfile.txt and MyFile.txt is in there, it will
    return true. However, other programs do care about the case (myfile
    and MyFile are different), which is why I need to do what I am doing.

    Am I right on this or is there something I am missing? I'm not a code
    expert - this is a tweak on an existing program.

    orljustin, Jun 24, 2005
    1. Advertisements

  2. Are you right on WHAT? Windows 2000 file system is case-insensitive.
    I am not sure, I'd have to see some code, but you probably are mixing up
    concepts: case sensitivity of the language and case sensitivity of the
    file system (operating system). The latter is off-topic here. You might
    want to ask in about that.

    Victor Bazarov, Jun 24, 2005
    1. Advertisements

  3. orljustin

    Mike Smith Guest

    Well, those programs are doing it wrong. Windows filesystems are
    case-insensitive. You can't even *have* myfile.txt and MyFile.TXT in
    the same directory; Windows won't let you. The programs you've
    encountered that are case-sensitive are most likely Unix ports that did
    not take into account this Unix/Windows difference.
    Mike Smith, Jun 24, 2005
  4. orljustin

    orljustin Guest

    Hi again,

    Thanks. I am doing the work on a windows box, but the files get put on
    and used on a Unix box. Thus, the concern about whether the correctly
    cased file is in the directory. It's a long story, but it sounds like
    I won't be able to do my case check.

    orljustin, Jun 24, 2005
  5. Yes, its off topic. But just to be clear, there is no such thing as a
    Windows 200 file system. There's NTFS, and a couple versions of FAT. NTFS
    is case sensitive, and that is the most common Windows 2000 file system.
    Steven T. Hatton, Jun 24, 2005
  6. orljustin

    Stephen Howe Guest

    Windows is case-insensitive but case-retentive.
    So opening files using fstream that differ in case only is opening the same
    But it is case-retentive in that if you can use rename() to change case and
    Windows will remember.

    Stephen Howe
    Stephen Howe, Jun 25, 2005
  7. * Mike Smith:
    Sorry, that's incorrect.

    But as Victor wrote elsewhere, that part of the question is off-topic in
    this group.
    Alf P. Steinbach, Jun 25, 2005
  8. orljustin

    Jack Klein Guest

    Extremely off-topic, but NTFS is case preserving, and not at all case
    sensitive. There is quite a difference.
    Jack Klein, Jun 26, 2005
  9. Yes, that was already addressed in a previous post. I guess I forgot about
    the idiosyncracies of NTFS in the 5 years since I stopped using it on a
    regular basis.
    Steven T. Hatton, Jun 26, 2005
  10. * Steven T. Hatton:
    Sorry, that's incorrect (Posix 0.9 semantics supported since NT 3.5x), and
    as Victor wrote, it's off-topic.
    Alf P. Steinbach, Jun 26, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.