Community
    • 登入

    Read-only does *NOT* work.

    已排程 已置頂 已鎖定 已移動 Help wanted · · · – – – · · ·
    4 貼文 2 Posters 2.7k 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • Martin BedanM
      Martin Bedan
      最後由 編輯

      Hi.
      Im here from a different context. I made some changes to a cfg file, and even created new ones. Of course I used notepad++ to open those cfg files and edit them. I tried to set them to read-only, and it worked for about less than 1 minute, and then they changed back from read-only. I dont seem to be able to set them to read-only for more than 1 minute. What is wrong?
      I tried different things like SAVING the files as read-only, and even set them as read-only AFTER I saved the files. I basically tried a lot.
      I want to do this because my game (counter-strike global offensive) keeps modifying the cfg files when I launch or exit the game. So by setting the files to read-only, this should not happen according to people with more knowledge than me. But even when I DONT launch or exit the game - just by waiting, the files will remove the read-only.
      Hope I am clear in my explanation.

      Any help is appreciated. Thanks tons in advance.

      Best regards,
      Martin.

      Claudia FrankC 1 條回覆 最後回覆 回覆 引用 0
      • Claudia FrankC
        Claudia Frank @Martin Bedan
        最後由 編輯

        @Martin-Bedan

        I can’t imagine that npp is causing this issue. I would suggest that you download
        procmon from sysinternals suite and run it with a filter like path ends with YOUR_FILE.cfg.
        Start npp, edit the file (now you should see in procmon that notepad++.exe accesses your file),
        set read-only and then wait until flag has been reset. Procmon should tell you which process
        was responsible. (having CS in mind)

        Btw. to make a file really read-only you need to remove the permission to make it “writable”
        again from the users acls, otherwise every program, which runs under the same or higher
        privilege level as the user has, is able to undo those changes.

        Cheers
        Claudia

        1 條回覆 最後回覆 回覆 引用 0
        • Martin BedanM
          Martin Bedan
          最後由 編輯

          Thanks for the reply Claudia. I found a workaround.

          But if I need to edit the file, I remove the read-only. When I remove the read-only, will my previously made changes in the file not get deleted/reset? This tends to happen in cfg files.

          thanks

          //Martin

          Claudia FrankC 1 條回覆 最後回覆 回覆 引用 0
          • Claudia FrankC
            Claudia Frank @Martin Bedan
            最後由 編輯

            @Martin-Bedan

            removing the read-only flag doesn’t change the content of a file but
            of course makes a process able to do changes again so it might be that
            some queued changes do get flushed as soon as the process determines that it can
            write to the file. But this is not the behavior of npp.

            Cheers
            Claudia

            1 條回覆 最後回覆 回覆 引用 1
            • 第一個貼文
              最後的貼文
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors