Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to write files in case insensitive linux?
Forum Updated to NodeBB v4.3 + New Features

how to write files in case insensitive linux?

Scheduled Pinned Locked Moved Solved General and Desktop
12 Posts 3 Posters 637 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E emazed

    Dear sirs,

    I have this scenario and can't figure out how to let it work:
    I am working with a custom debian 64 bit case INsensitive os, and i experience problems writing files to hdd location that is not /home/user/.

    I installed Qt Creator 10.xx and Qt 5.15.2 through linux installer.

    If i try to edit a file with Qt Creator, or if i use QFile to write something to hdd, both methods work only if the destination location is inside /home/user/. Outside of this path, i can t write anything.
    The permissions for writing are ok, i am thinking that the case insensitive operating system could be a problem.
    Is there a workaround for this? Can i do something to test if the problem comes out from case insensitivity os? Has anyone experience with similar problem?

    Kind Regards
    emazed

    JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by
    #2

    @emazed
    I have never heard of/used case-insensitive filing system under Linux. But if you have QFile::open() failing then your first port of call is to look at what QString QIODevice::errorString() const says.....

    1 Reply Last reply
    3
    • E emazed

      Dear sirs,

      I have this scenario and can't figure out how to let it work:
      I am working with a custom debian 64 bit case INsensitive os, and i experience problems writing files to hdd location that is not /home/user/.

      I installed Qt Creator 10.xx and Qt 5.15.2 through linux installer.

      If i try to edit a file with Qt Creator, or if i use QFile to write something to hdd, both methods work only if the destination location is inside /home/user/. Outside of this path, i can t write anything.
      The permissions for writing are ok, i am thinking that the case insensitive operating system could be a problem.
      Is there a workaround for this? Can i do something to test if the problem comes out from case insensitivity os? Has anyone experience with similar problem?

      Kind Regards
      emazed

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #3

      @emazed said in how to write files in case insensitive linux?:

      Outside of this path, i can t write anything.

      Non root users can't write outside of their home folder, except in /tmp
      Also, not the operating system is case insensitive, but the file system.

      But as @JonB already wrote: add at least basic error handling to your app to see what exactly the problem is...

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      E 1 Reply Last reply
      2
      • jsulmJ jsulm

        @emazed said in how to write files in case insensitive linux?:

        Outside of this path, i can t write anything.

        Non root users can't write outside of their home folder, except in /tmp
        Also, not the operating system is case insensitive, but the file system.

        But as @JonB already wrote: add at least basic error handling to your app to see what exactly the problem is...

        E Offline
        E Offline
        emazed
        wrote on last edited by
        #4

        Ok, i tested QFile,
        QOpen and QWrite are working fine, so i was wrong. The problem is only happening editing files within QtCreator.
        I open a file, add some few characters, then i save, and i get a messagebox stating:
        Cannot write /testfile.txt, no such file or directory.
        Is somethig related to permissions for QtCreator? it is something simple?

        Kind Regards
        emazed

        JonBJ 1 Reply Last reply
        0
        • E emazed

          Ok, i tested QFile,
          QOpen and QWrite are working fine, so i was wrong. The problem is only happening editing files within QtCreator.
          I open a file, add some few characters, then i save, and i get a messagebox stating:
          Cannot write /testfile.txt, no such file or directory.
          Is somethig related to permissions for QtCreator? it is something simple?

          Kind Regards
          emazed

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #5

          @emazed said in how to write files in case insensitive linux?:

          Cannot write /testfile.txt, no such file or directory.

          If that path is really /testfile.txt, which starts with a /, and it's not somehow set up so that refers into your /home/user area (e.g. by a chroot) then you should not have permission to write there. I don't know about "no such file or directory" message, but maybe you need to save back to a different path.

          E 1 Reply Last reply
          1
          • JonBJ JonB

            @emazed said in how to write files in case insensitive linux?:

            Cannot write /testfile.txt, no such file or directory.

            If that path is really /testfile.txt, which starts with a /, and it's not somehow set up so that refers into your /home/user area (e.g. by a chroot) then you should not have permission to write there. I don't know about "no such file or directory" message, but maybe you need to save back to a different path.

            E Offline
            E Offline
            emazed
            wrote on last edited by
            #6

            @JonB

            the full message is "Cannot write file /C/Qt_Sources/testfile/filemorto.txt: No such file or directory".
            Yes it is outside /home/user. I know, now this question is out of scope of Qt forum, and it s more a linux related problem, but is there a way to let it work, instead of copying all source file to /home/user?
            Anyway many thanks, my ideas are a bit clearer now...

            King Regards
            emazed

            JonBJ 1 Reply Last reply
            0
            • E emazed has marked this topic as solved on
            • E emazed

              @JonB

              the full message is "Cannot write file /C/Qt_Sources/testfile/filemorto.txt: No such file or directory".
              Yes it is outside /home/user. I know, now this question is out of scope of Qt forum, and it s more a linux related problem, but is there a way to let it work, instead of copying all source file to /home/user?
              Anyway many thanks, my ideas are a bit clearer now...

              King Regards
              emazed

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #7

              @emazed said in how to write files in case insensitive linux?:

              the full message is "Cannot write file /C/Qt_Sources/testfile/filemorto.txt: No such file or directory"

              Then please don't write Cannot write /testfile.txt, no such file or directory., it's a completely different path, if you want help you have to tell us what is actually happening not something different which you feel like typing in!

              I cannot imagine why you have a path starting /C/... when you say you are under Linux. You have never mentioned anything about Windows, which it looks like this is connected with....

              So if the error message states

              "Cannot write file /C/Qt_Sources/testfile/filemorto.txt: No such file or directory".

              can you confirm that (a) the directory /C/Qt_Sources/testfile exists and (b) what its permissions are. ls -ld /C/Qt_Sources/testfile would probably do it.

              E 2 Replies Last reply
              3
              • JonBJ JonB

                @emazed said in how to write files in case insensitive linux?:

                the full message is "Cannot write file /C/Qt_Sources/testfile/filemorto.txt: No such file or directory"

                Then please don't write Cannot write /testfile.txt, no such file or directory., it's a completely different path, if you want help you have to tell us what is actually happening not something different which you feel like typing in!

                I cannot imagine why you have a path starting /C/... when you say you are under Linux. You have never mentioned anything about Windows, which it looks like this is connected with....

                So if the error message states

                "Cannot write file /C/Qt_Sources/testfile/filemorto.txt: No such file or directory".

                can you confirm that (a) the directory /C/Qt_Sources/testfile exists and (b) what its permissions are. ls -ld /C/Qt_Sources/testfile would probably do it.

                E Offline
                E Offline
                emazed
                wrote on last edited by
                #8

                @JonB

                ok here is what i have:
                i am working with this custom os, that has been created for work. It s a company proprietary OS. Both the file system (case insensitive) and the /C/ folder, seems (i am not sure about it) an attempt to recreate a linux environment similar to Windows.
                I see from / folder that /C/ folder is a link pointing to /home/z32/.C folder.
                ls -l in / folder returns for /C lrwxrwxrwx 1 root root ... C -> /home/z32/.C
                while
                ls -l at /C/Qt_Sources/testfile yelds -rw-r--r-- 1 z32 z32 .... filemorto.txt

                the file exist, seems to be out of scope of creator.... pretty strange

                thanks
                Kind Regards
                emazed

                JonBJ 1 Reply Last reply
                0
                • JonBJ JonB

                  @emazed said in how to write files in case insensitive linux?:

                  the full message is "Cannot write file /C/Qt_Sources/testfile/filemorto.txt: No such file or directory"

                  Then please don't write Cannot write /testfile.txt, no such file or directory., it's a completely different path, if you want help you have to tell us what is actually happening not something different which you feel like typing in!

                  I cannot imagine why you have a path starting /C/... when you say you are under Linux. You have never mentioned anything about Windows, which it looks like this is connected with....

                  So if the error message states

                  "Cannot write file /C/Qt_Sources/testfile/filemorto.txt: No such file or directory".

                  can you confirm that (a) the directory /C/Qt_Sources/testfile exists and (b) what its permissions are. ls -ld /C/Qt_Sources/testfile would probably do it.

                  E Offline
                  E Offline
                  emazed
                  wrote on last edited by
                  #9

                  @JonB
                  too complicated, i need support from the person who created this. I will ask help to him. Inside /home/z32 there are a lot of hidden folders, and one of these called ".Cdata" seems a copy of ".C" but with all lowercase names. Editing files within ".Cdata" works and also changes the content of ".C" folder.
                  QtCreator can handle correctly the content in ".Cdata", while can t see anything whithin ".C" folder. This is actually too messy and goes beyond my capabilities. I will ask to the author of this os.

                  Thanks for hints

                  best regards
                  emazed

                  1 Reply Last reply
                  0
                  • E emazed

                    @JonB

                    ok here is what i have:
                    i am working with this custom os, that has been created for work. It s a company proprietary OS. Both the file system (case insensitive) and the /C/ folder, seems (i am not sure about it) an attempt to recreate a linux environment similar to Windows.
                    I see from / folder that /C/ folder is a link pointing to /home/z32/.C folder.
                    ls -l in / folder returns for /C lrwxrwxrwx 1 root root ... C -> /home/z32/.C
                    while
                    ls -l at /C/Qt_Sources/testfile yelds -rw-r--r-- 1 z32 z32 .... filemorto.txt

                    the file exist, seems to be out of scope of creator.... pretty strange

                    thanks
                    Kind Regards
                    emazed

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by
                    #10

                    @emazed said in how to write files in case insensitive linux?:

                    ls -l at /C/Qt_Sources/testfile yelds -rw-r--r-- 1 z32 z32 .... filemorto.txt

                    I (deliberately) asked you to run ls -ld /C/Qt_Sources/testfile, but you have chosen to only use ls -l instead....

                    E 1 Reply Last reply
                    2
                    • JonBJ JonB

                      @emazed said in how to write files in case insensitive linux?:

                      ls -l at /C/Qt_Sources/testfile yelds -rw-r--r-- 1 z32 z32 .... filemorto.txt

                      I (deliberately) asked you to run ls -ld /C/Qt_Sources/testfile, but you have chosen to only use ls -l instead....

                      E Offline
                      E Offline
                      emazed
                      wrote on last edited by
                      #11

                      @JonB
                      sorry i wrongly thought it were a mistake.
                      from /, ls -ld gives:
                      drwxr-xr-x 2 z32 z32 4096 Jun 27 11:59 /C/Qt_Sources/testfile
                      this is the only line i get as output

                      kind regards
                      emazed

                      JonBJ 1 Reply Last reply
                      0
                      • E emazed

                        @JonB
                        sorry i wrongly thought it were a mistake.
                        from /, ls -ld gives:
                        drwxr-xr-x 2 z32 z32 4096 Jun 27 11:59 /C/Qt_Sources/testfile
                        this is the only line i get as output

                        kind regards
                        emazed

                        JonBJ Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by JonB
                        #12

                        @emazed
                        Fair enough. Assuming you are user z32, both the directory and the file in it you happen to be trying to save do both show as writable by you.

                        the full message is "Cannot write file /C/Qt_Sources/testfile/filemorto.txt: No such file or directory".

                        The fact that this spits out No such file or directory on what I believe you have now shown is a writable file in a writable directory, rather than say Permission denied, hints to me that there is something "funny" going on. Then again, if you say it is only Qt Creator which does so, nothing else, is curious.

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved