Community
    • Login

    Read-only does *NOT* work.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 2.5k Views
    Loading More Posts
    • 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.
    • Martin BedanM
      Martin Bedan
      last edited by

      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 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @Martin Bedan
        last edited by

        @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 Reply Last reply Reply Quote 0
        • Martin BedanM
          Martin Bedan
          last edited by

          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 Reply Last reply Reply Quote 0
          • Claudia FrankC
            Claudia Frank @Martin Bedan
            last edited by

            @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 Reply Last reply Reply Quote 1
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors