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. i can't write in programfiles(x86)
Forum Updated to NodeBB v4.3 + New Features

i can't write in programfiles(x86)

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 1.2k Views
  • 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.
  • Z Offline
    Z Offline
    Zunneh
    wrote on last edited by
    #1

    Hello guys, i made a program to write in text file , when my text file is out of program files(x86) , i can edit it but when my text file is in program files(x86) i can't edit it , someone can help me why i can't write when the text file is in program files ? thanks
    P.S: i m on windows 10

    my english is average, please use simple words and try to be the most explicit, thank you

    aha_1980A 1 Reply Last reply
    0
    • Z Zunneh

      Hello guys, i made a program to write in text file , when my text file is out of program files(x86) , i can edit it but when my text file is in program files(x86) i can't edit it , someone can help me why i can't write when the text file is in program files ? thanks
      P.S: i m on windows 10

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Zunneh said in i can't write in programfiles(x86):

      someone can help me why i can't write when the text file is in program files ?

      Very simple: Windows forbids it.

      Solution: Forget it - it's tons of worms if you try. We had old programs that did such things and we needed to install them outside program files on Windows 10 because it was simply impossible to do.

      The better solution, however, is to store the data in the users directory: C:\Users\xxx\

      Regards

      Qt has to stay free or it will die.

      Z 1 Reply Last reply
      4
      • aha_1980A aha_1980

        @Zunneh said in i can't write in programfiles(x86):

        someone can help me why i can't write when the text file is in program files ?

        Very simple: Windows forbids it.

        Solution: Forget it - it's tons of worms if you try. We had old programs that did such things and we needed to install them outside program files on Windows 10 because it was simply impossible to do.

        The better solution, however, is to store the data in the users directory: C:\Users\xxx\

        Regards

        Z Offline
        Z Offline
        Zunneh
        wrote on last edited by
        #3

        @aha_1980 Thank you for the quick reply , do you have an idea why Windows forbids it ?

        my english is average, please use simple words and try to be the most explicit, thank you

        J.HilkJ 1 Reply Last reply
        0
        • Z Zunneh

          @aha_1980 Thank you for the quick reply , do you have an idea why Windows forbids it ?

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @Zunneh you should look into QStandardPaths to get cross platform locations to write read and store data
          https://doc.qt.io/qt-5/qstandardpaths.html

          For why windows does not allow it, security reasons I would assume. Prevents mallware from messing with with importand programs.

          To be honest, Windows is a good bit behind on that compared to other os, on Mac for example each program is its own seperated sandbox. Very hard to break out of that 😉


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          4

          • Login

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