edit readonly files

  • Anonymous - 2010-01-26

    I can't seem to find any option to allow me to update a read-only file. Whenever I open a readonly file it is locked for updates.

    Any help would be appreciated. This is the only editor I know that stops me from doing this and it makes no sense. I know I could save the file first but sometimes I just want to update, print and leave or dump my brain into the file before figuring out where I want to save it to.


  • cchris

    cchris - 2010-01-26

    Remove the read-only attribute from the OS shell, for instance Windows Explorer, usually by right clicking the file and choosing Properties.

    As a side note, for the examples you give, why would the file be read-only anyway?


  • TheEpicSnail

    TheEpicSnail - 2011-03-23

    I just ran into a need for this functionality and after googling found this thread.
    Here's the scenario:
    Where I work we have a copy of a repository that has read-only access unless we check out files. While looking through some code that I don't have checked out (so it's read only) I would like to make some notes "//This returned 1" for example.
    However these changes i would not want saved, but since its read only I can't even jot down notes

    I could also see something like opening a configuration file or something you don't have access to write to, but would like a local customized copy, currently you would have to copy the file, then edit it, verses opening the read only file, editing, then 'save as'.

  • cchris

    cchris - 2011-03-24

    When you load a read-only file, the logical, ie internal to Notepad++, readonly flag is set. You can always Edit -> Clear Read-only flag, go ahead and edit.
    Save won't work, Save As will. If youdon't want to bother about the saved modified version, you can use some automated solutions:
    * turn backup on;
    * Use the AutoSave plugin
    * Still Save As, but use a favourite folder list to mindlessly select some tempfile for the copies. I use the last free version of Dialog Box Assistant, serves me well.

    I just experimented and found out something I'd consider a bug:
    * if a file is not read-only filesystem-wise, clearing or setting the read only flag in N++ will only affect your ability to edit, not to save.
    * If a file is read only filesystem-wise, clearing he flag from N++ DOES clear it on the file system, so you can edit and save at will.
    Tested with 5.8.7 Unicode, WinXP 32 Pro, unpriveleged account.


  • Robert Templeman

    The default behaviour should be to allow in memory editing of read-only files and overwrite with a prompt informing the user of the read-only flag. In addition, the initial read-only warning dialog should have a permanent 'disable warning' checkbox.
    This issue has wasted significant time for me and a very surprising omission to the preferences.

  • Redoute

    Redoute - 2013-12-13

    The current behaviour is quirky in several ways.

    • There is no (visual) hint that a file was opened read only, I would expect something in the title and/or in the status bar. OK, I admit the tab bar icon differs, but this is nearly unvisible. See MS Office for what I would expect.
    • There is even no feedback at all when you try to type something, which can leave you baffled (like I was when I tried to look into some XML file and wanted to use XML tool's pretty-print).
    • As resort N++ offers to unset the read-only file attribute, which IMO should be left to the file manager. After all you didn't set this attribute with N++.
    • This applies to files with ro flag, but not to files in folders without write permissions - inconsistent.
    • When I edit a file in a read-only folder and want to save it, I get a misleading message the file may be open in another program. On the other side there are good and clear messages when I try to "save as" over a read-only file, respectively when I try to "save as" into a folder without write permissions.

    Every other program I know refuses to overwrite read-only files (at least because it can't do so unintentional), but none refuses to edit them.
    Just my two cents ...

  • cchris

    cchris - 2013-12-15

    Actually, the read only flag is only something internal to Notepad++, and initially set to its filesystem counterpart. So the actual protection is left to the file system, with the added flexibility that you can protect a master file while editing in N++, leaving it open to edit in other ways. The drawback is that the two are not correlated tightly.

    So, in a nutshell:
    You'd like some/a different feedback when editing a read-only file
    An explicit message when saving a file that you can't write to


    • Redoute

      Redoute - 2013-12-16

      Sorry CChris, I think you misunderstood my first post:

      only something internal to Notepad++

      The "Clear Read-Only Flag" menu item removes the file attribute, when possible. So it is not possible to edit a file in-memory without giving up it's write protection.

      You'd like some/a different feedback when editing a read-only file
      An explicit message when saving a file that you can't write to

      No, this messages exist (though the one about "opened in another program" when there is no write access to the folder is misleading).

      1. I'd like to have an explicit message when I try to start typing/editing in vain.

      2. I'd even more like to be able to edit a read-only file in-memory without clearing a flag, like in every other comparable program I can think of.

      3. I'd like to have consistent behaviour, regardless if the file itself or it's folder/medium is write protected.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks