• ByteWelder@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    13 days ago

    The main problem with case-insensitive is that software sometimes is lazily developed: If a file is named “File.txt” and a program opens “file.txt”, then on a case-insensitive file system it will work fine. If you then format your drive to case-sensitive, the same software now fails to load the file. Source: tried case-sensitive filesystem on macOS some years ago.

    • BeardedGingerWonder@feddit.uk
      link
      fedilink
      English
      arrow-up
      0
      ·
      12 days ago

      Vscode does not handle this well the one time I accidentally created 2 files with different cases. On one level it recognises them both as separate files, but other time thinks they’re the same.

  • SwingingTheLamp@midwest.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    13 days ago

    Case-sensitive is easier to implement; it’s just a string of bytes. Case-insensitive requires a lot of code to get right, since it has to interpret symbols that make sense to humans. So, something over wondered about:

    That’s not hard for ASCII, but what about Unicode? Is the precomposed ç treated the same lexically and by the API as Latin capital letter c + combining cedilla? Does the OS normalize all of one form to the other? Is ß the same as SS? What about alternate glyphs, like half width or full width forms? Is it i18n-sensitive, so that, say, E and É are treated the same in French localization? Are Katakana and Hiragana characters equivalent?

    I dunno, as a long-time Unix and Linux user, I haven’t tried these things, but it seems odd to me to build a set of character equivalences into the filesystem code, unless you’re going to do do all of them. (But then, they’re idiosyncratic and may conflict between languages, like how ö is its letter in the Swedish alphabet.)

    • pedz@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      13 days ago

      This thread is giving me flashbacks to the times before Unicode, when swapping files between Windows and Linux partitions would have a good chance of fucking up every non-ASCII characters in their names.

      There was ways to set it up so the ISO character sets would match, but it was still a giant pain to deal with different ones.

      Blessed be Unicode.

      • zarenki@lemmy.ml
        link
        fedilink
        arrow-up
        0
        ·
        12 days ago

        A related issue I still see very often, even with files newly created just this year, is when trying to extract zip files on my Linux systems that contain non-ASCII filenames and that were created on Windows systems, especially ones with apparently non-English locales like Japanese. Need to trial and error the locale I give to unzip and sometimes hack together fixed names with iconv until the mojibake seems to fix itself.

      • DefederateLemmyMl@feddit.nl
        link
        fedilink
        English
        arrow-up
        0
        ·
        12 days ago

        It tells you there’s a name clash, and then it clones it anyway and you end up with the contents of README.MD in README.md as an unstaged change.

        • lseif@sopuli.xyz
          link
          fedilink
          arrow-up
          0
          ·
          12 days ago

          sounds like actually a good solution … tho doesnt sound like it would work for more than 2 similarly-named files

          • DefederateLemmyMl@feddit.nl
            link
            fedilink
            arrow-up
            0
            ·
            12 days ago

            I don’t think it’s intended as a “solution”, it just lets the clobbering that is caused by the case insensitiveness happen.

            So git just goes:

            If you add a third or fourth file … it would just continue, and file gets checked out first gets the filename and whichever file gets checked out last, gets the content.

  • hark@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    13 days ago

    I sometimes run into this when I extract an archive file on Windows and there are files named with different cases but are otherwise the same. I prefer case-sensitivity because I like precision and fewer assumptions being made about a system and how it’s used.

  • calcopiritus@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    13 days ago

    I’m with windows on this one. Case insensitive is much more ergonomics with the only sacrifice represented by this meme. And a little bit of performance of course. But the ergonomics are worth it imo.

    • KillingTimeItself@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      0
      ·
      13 days ago

      so cool story, on linux theres this thing called you can just not make case sensitive files, i do it a lot.

      You can also just, use a case insensitive autocomplete setup as well. If you’re using a mouse idk why you’re even talking about this so that wouldn’t matter.

      • calcopiritus@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        13 days ago

        When you say "canse insensitive file*, do you mean lowercase files? Or is there an option?

        Idk why we talking about mouses. When I’m on Linux, most of the time it’s through ssh.

        • KillingTimeItself@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          0
          ·
          12 days ago

          either or, whatever the fuck you want really.

          You can just not use capital letters if you feel like it. Works pretty well. Or just use a case insensitive shell handler for pretending it’s not actually cased at all.

          Hell im pretty sure you could just render all of the text in a certain case and call it a day lol.

          • exu@feditown.com
            link
            fedilink
            English
            arrow-up
            0
            ·
            13 days ago

            If I have two folders in my directory, Dir1 and dir2, what does d <TAB> autocomplete to and what should it do?

            • boomzilla@programming.dev
              link
              fedilink
              arrow-up
              0
              ·
              12 days ago

              In fish it would immediately expand to dir2.

              If you have “Dir1” and “DIR2” and you type “cd d”, your prompt will look like in the next picture. Fish automatically transforms “d” into “D”, because there is no dir starting with the lowercase “d”.

              On a subsequent <TAB> you’ll get a list of dirs matching your prompt so far in which you choose an entry with the cursor key and enter it with the enter key.

            • ReCursing@lemmings.world
              link
              fedilink
              arrow-up
              0
              ·
              13 days ago

              In the case of zsh it will quite happily do either and ask you which you meant just like if they were called Dir1 and Dir2. Also works if you have a dir1 and Dir2 in the same directory as well

  • potentiallynotfelix@lemdro.id
    link
    fedilink
    English
    arrow-up
    0
    ·
    13 days ago

    you mean ntfs and fat are, not windows itself. if windows supported ext4, it wouldn’t have case sensitivity on an ext4 drive

  • KillingTimeItself@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    13 days ago

    you can also use basically anything that’s not / in a file name as well, it’s pretty based. Meanwhile on windows you have to use SMB mappings if you don’t want your directory structure to self immolate, what a good operating system.

    • EddoWagt@feddit.nl
      link
      fedilink
      arrow-up
      0
      ·
      13 days ago

      I recently renamed a few movie files to something with ‘:’. That worked fine on Linux, but lead to some issues on windows. With a lot of errors from next cloud for file sync and me not being able to rename them without booting back to Linux. Fun stuff

      • KillingTimeItself@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        0
        ·
        12 days ago

        if you’re using samba file sharing across OS’s (like you should) you should use something called catia:mappings in order to solve that problem. It means shit like colon will be mapped to a different character, but there are some sane mappings out there that you can use.

        • EddoWagt@feddit.nl
          link
          fedilink
          arrow-up
          0
          ·
          12 days ago

          It wasn’t a file share, I have one of my drives mounted in Linux and in Windows as a general storage drive in a dualboot system

      • KillingTimeItself@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        13 days ago

        i’m not sure if you’re allowed to escape the / character, i feel like it’s blatantly illegal. But you could use the funny character set trolling thing instead, where you use a not forward slash instead. (not the \)

      • ulterno@lemmy.kde.social
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        13 days ago

        Just tried. It processes the escape first and then finds the path with it. Essentially, making it look into a directory made by the characters before the \/.

        The above was when I tried:

        echo "asd" > asd\/dsa
        

        But then I tried using Dolphin (GUI File Browser) to make a file and:

        ls
         1   2   3   4  'asd\⁄sad.txt'ls
        1  2  3  4  asd⁄sad.txt
        

        In the first one, the backslash is not the escape character, but part of the text.

        • KillingTimeItself@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          0
          ·
          edit-2
          12 days ago

          Turns out Dolphin just replaces the forward slash with U+2044 “Fraction Slash” character, hence, not requiring any escape. I’d call that cheating, but it works well.

          called it, i knew someone would use illegal characters eventually.

          • ulterno@lemmy.kde.social
            link
            fedilink
            English
            arrow-up
            0
            ·
            edit-2
            12 days ago

            I would have a problem if a terminal app were to do something like this, but for GUI apps, it is expected for them to make stuff easier.
            And I feel like, if you were to use a slash in a file name, it would most probably be either an “or” slash or a fraction slash, so the substitution is fine in my books.

            illegal characters

            Not sure about calling it that, considering it is a standard UTF-8 character. (0x2044 in UTF-16)

            • KillingTimeItself@lemmy.dbzer0.com
              link
              fedilink
              English
              arrow-up
              0
              ·
              12 days ago

              I would have a problem if a terminal app were to do something like this, but for GUI apps, it is expected for them to make stuff easier. And I feel like, if you were to use a slash in a file name, it would most probably be either an “or” slash or a fraction slash, so the substitution is fine in my books.

              it’s close enough, i generally consider an “illegal” character a non typable character. Especially these alt characters that are visually hard to distinguish from others such as the forward slash for example, i believe this was the same character used for a handful of somewhat clever phishing scams.

              Seems like it’s fair enough to me.

  • linearchaos@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    12 days ago

    Yeah I’ve been using Linux for a very long time. The amount of time I’ve spent on the case being incorrect is non-trivial. I’ve gotten better at not screwing it up throughout the years but the sum of advantages is far outweighed by the sum of debugging time spent.