• Login
Community
  • Login

Fix corrupted txt file (NULL)

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
corruptedfixtextnullfile
114 Posts 37 Posters 144.4k 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.
  • M
    Meta Chuh moderator @dontEatMe
    last edited by Feb 17, 2019, 2:05 PM

    @dontEatMe

    if you say that some of your files got restored by previous versions of the same file using 7.5.9, some possible reasons are:

    • you have multi-instance enabled, and auto backup and periodic snapshot is enabled, and at one time you had the same file opened in 2 different instances without noticing it, where one of them was not saved, which is the version that will be restored, even though you saved the same file with newer contents at the other instance.

    • you have more than one notepad++ installed, eg. an installed one and a portable one, and auto backup and periodic snapshot is enabled, and you have modified the same file from both of them, and one of them was not saved and is restored from the snapshot that contains an older state.

    1 Reply Last reply Reply Quote 1
    • P
      pnedev
      last edited by Feb 18, 2019, 1:20 PM

      @Alan-Kilborn said:

      This is BAD as 7.5.9 supposedly fixed this problem!

      The problem that was fixed was regarding the case you had backup turned on - in some cases a race condition occurred between backup operation and currently running action in the editor.

      There is other possible problem connected with sudden power loss but I don’t think Notepad++ is to blame for this.

      As @redneck-f25 said a few posts above:

      Anyway, after disabling the write cache on the not-write-protected disk, everything went fine.
      So probably this is NOT an error caused and CANNOT be fixed by NPP.

      1 Reply Last reply Reply Quote 4
      • S
        Summer Begin
        last edited by Oct 24, 2019, 10:56 AM

        Just happened to me. Can’t even recover with the recovery software. It appears notepad++ need to improve the way it saves data, i.e. do not remove the copy of overwritten file until the saving is successful. (I was using one or two version before Notepad++ v7.7.1, have now upgraded though so can’t tell which version it was)

        1 Reply Last reply Reply Quote 2
        • A
          Alex Barker
          last edited by Nov 26, 2019, 12:19 AM

          Glad to see this is still an issue 3 years after being reported. I just ran into this problem when saving and then closing the laptop lid that initiated a reboot because how else is Windows suppose to destroy your data. I will be taking this opportunity to never use notepad++ again. Thanks.

          1 Reply Last reply Reply Quote 2
          • A
            Afroja Noon
            last edited by Jan 23, 2020, 5:59 AM

            I am sorry to say that I cannot tell you a way to fix the corrupted files. But what I can tell you is this isn’t npps fault,
            The culprit is Windows itself. Turn this off to avoid future losses. I lost my 7 days of work to this.
            ![The culprit](6e1d09b6-f495-4cd5-91d0-4cc3badf811e-image.png image url)
            The solution:
            ![Solution](007a186c-4e3a-4331-8d1a-72507d93e965-image.png image url)

            P 1 Reply Last reply Jan 23, 2020, 9:07 AM Reply Quote 5
            • P
              pnedev @Afroja Noon
              last edited by Jan 23, 2020, 9:07 AM

              @Afroja-Noon ,

              You are right, although Notepad++ can use the appropriate Windows APIs to flush the write cache when saving and circumvent this.
              The common user is not obliged to know such details and deal with system configuration nonsense before doing a simple text editing.
              If I were an uninformed user and lost my saved data edited in Notepad++ I would loose trust in the editor too.

              BR

              P 1 Reply Last reply Jan 24, 2020, 3:15 PM Reply Quote 6
              • P
                PeterJones @pnedev
                last edited by Jan 24, 2020, 3:15 PM

                @pnedev said in Fix corrupted txt file (NULL):

                although Notepad++ can use the appropriate Windows APIs to flush the write cache when saving and circumvent this.

                @pnedev, were those the changes you have committed as referenced in #6133? Were any or all of those changes incorporated into the codebase? (I see that #6164 was closed, but more changes were made after that, so I’m not sure the rest of your fixes were ever incorporated.)

                P 1 Reply Last reply Jan 28, 2020, 8:54 AM Reply Quote 0
                • P
                  pnedev @PeterJones
                  last edited by pnedev Jan 28, 2020, 8:56 AM Jan 28, 2020, 8:54 AM

                  Hi @PeterJones,

                  Yes, https://github.com/notepad-plus-plus/notepad-plus-plus/pull/6164 is the PR that should fix this problem but as Don decided to reject it it is not merged but simply closed.
                  The later changes perhaps appear because of the patch re-bases in my Npp code clone (https://github.com/pnedev/notepad-plus-plus/commit/5397cd9030fbc23265b4d409e4c61c59ab1c8887).
                  This is because I have mentioned the issue numbers in the commit message.

                  BR

                  1 Reply Last reply Reply Quote 3
                  • S
                    Siulfer Mosqueira
                    last edited by Mar 30, 2020, 10:41 AM

                    I solved my corrupt file with Recuva software after a blue screen in windows, I followed the instructions in the following post: https://superuser.com/questions/377904/recover-file-corrupted-due-to-power-cut-off and voila!! Thanks

                    corrupt_file_null.jpg

                    1 Reply Last reply Reply Quote 2
                    • B
                      Ben @Christina Toumanidou
                      last edited by Jun 15, 2020, 4:29 PM

                      @Christina-Toumanidou Nope. Doesn’t work.

                      1 Reply Last reply Reply Quote 0
                      • B
                        Ben
                        last edited by Jun 15, 2020, 4:41 PM

                        This issue is STILL happening in 2020 under NotePad++ 7.8.5 ! We just had a power outage and upon reboot everything was fine (11 open files) except for the current file I was working on. I just lost 5 hours of work. I hit CTRL-S almost every 10 seconds when developing. 163KB code file filled with NUL characters, this is insane!

                        For the record:

                        • Backup on save was set to “None”.

                        Here’s what NotePad++ shows when opening the file:

                        asd1.PNG

                        Here’s what Recuva gave me, absolutely useless. F*** !!!

                        asd2.PNG

                        I cannot believe this is happening to me right now. 5 hours of work destroyed for no reason. This isn’t 1991 anymore. WTF?

                        E P 2 Replies Last reply Jun 15, 2020, 6:10 PM Reply Quote 2
                        • E
                          Ekopalypse @Ben
                          last edited by Jun 15, 2020, 6:10 PM

                          @Ben said in Fix corrupted txt file (NULL):

                          Backup on save was set to “None”.

                          But session snapshot and periodic backup is set?
                          If so, then it might be that the real files are still valid and
                          only the temporary files have been corrupted.

                          I hit CTRL-S almost every 10 seconds when developing

                          Which then can mean, that your data loss is only for the last ten seconds.

                          A 1 Reply Last reply Jun 15, 2020, 6:15 PM Reply Quote 0
                          • A
                            Alan Kilborn @Ekopalypse
                            last edited by Alan Kilborn Jun 15, 2020, 6:17 PM Jun 15, 2020, 6:15 PM

                            @Ekopalypse

                            OP said:

                            I hit CTRL-S almost every 10 seconds when developing

                            Doesn’t this imply that the user is working with a file that is NOT subject to periodic backup, but only subject to backup-on-save?
                            My understanding is that only unnamed files are subject to the periodic backup.

                            But then OP says

                            backup-on-save was None.

                            So to me this means that there was only ONE version of the file, and if it is corrupted, then, well, sadly, there isn’t anything to recover.

                            This also says to me that there is still a data-loss problem with Notepad++…

                            E 1 Reply Last reply Jun 15, 2020, 6:20 PM Reply Quote 1
                            • E
                              Ekopalypse @Alan Kilborn
                              last edited by Ekopalypse Jun 15, 2020, 6:21 PM Jun 15, 2020, 6:20 PM

                              @Alan-Kilborn said in Fix corrupted txt file (NULL):

                              Doesn’t this imply that the user is working with a file that is NOT subject to periodic backup, but only subject to backup-on-save?
                              My understanding is that only unnamed files are subject to the periodic backup

                              No, Npp creates for every unsaved file a backup.

                              backup-on-save was None.

                              Is just an additional option, afaik.

                              A 1 Reply Last reply Jun 15, 2020, 6:32 PM Reply Quote 0
                              • A
                                Alan Kilborn @Ekopalypse
                                last edited by Alan Kilborn Jun 15, 2020, 6:32 PM Jun 15, 2020, 6:32 PM

                                @Ekopalypse said in Fix corrupted txt file (NULL):

                                Npp creates for every unsaved file a backup.

                                I don’t find this to be true.
                                Change my mind! :-)

                                But start with a definition of “unsaved file” because this is ambiguous and could mean either:

                                • a file that has never been user-saved, and typically has a name like “new 3” for example, but could be renamed (without disk-saving) by the user
                                • a file that has been user-saved (to disk) at least once, but currently is modified/dirty (red disk icon)
                                E 1 Reply Last reply Jun 15, 2020, 6:43 PM Reply Quote 2
                                • E
                                  Ekopalypse @Alan Kilborn
                                  last edited by Jun 15, 2020, 6:43 PM

                                  @Alan-Kilborn

                                  The definition is, at least for me, correct and your explanation
                                  is correct too.
                                  What am I missing?

                                  A 1 Reply Last reply Jun 15, 2020, 6:49 PM Reply Quote 0
                                  • A
                                    Alan Kilborn @Ekopalypse
                                    last edited by Jun 15, 2020, 6:49 PM

                                    @Ekopalypse

                                    Maybe I/we got off track from the context of the OP’s problem.
                                    I’m supposing that the OP at the start created a new file and immediately gave it a disk-name, then continued working with the file.
                                    After doing that, there is no periodic backup automatically done on that file by Notepad++.
                                    So your advice to the OP about temporary files versus real files confuses me.
                                    But I can get out of the conversation.
                                    I will just listen and see if we get any more info from OP about the data loss.
                                    Obviously as a user of the product, I am always worried about my own data when I read such thread.

                                    E 1 Reply Last reply Jun 15, 2020, 6:59 PM Reply Quote 1
                                    • E
                                      Ekopalypse @Alan Kilborn
                                      last edited by Jun 15, 2020, 6:59 PM

                                      @Alan-Kilborn

                                      I’m confused as well.

                                      Assuming the configuration is like this

                                      9dc416d2-cbf3-4791-b9f0-d42003decf9b-image.png

                                      I use new 1 and type some nonsense text.
                                      At this point I will have a backup new 1 file which this content

                                      f4900d8b-3205-4efe-94b6-4dc15bf7f68c-image.png

                                      Now I save it with the name D:\nonsense.txt.
                                      The new 1 backup file is gone and there is NO d:\nonsense.txt backup. Now I’m going to change this file and voila

                                      a2f8dc02-99a2-4ca5-8f87-4e5da653d030-image.png

                                      So, what did I miss?

                                      A 1 Reply Last reply Jun 15, 2020, 7:11 PM Reply Quote 0
                                      • A
                                        Alan Kilborn @Ekopalypse
                                        last edited by Alan Kilborn Jun 15, 2020, 7:13 PM Jun 15, 2020, 7:11 PM

                                        @Ekopalypse

                                        Your explanation is correct.
                                        Without going into detail, my ramblings are just garbage. :-)
                                        I just have ways of working with N++ that are way safer than some things N++ allows you to do, and I tend to forget how some of these things work for others that don’t operate as safely. :-)

                                        1 Reply Last reply Reply Quote 1
                                        • B
                                          Ben
                                          last edited by Ben Jun 15, 2020, 7:37 PM Jun 15, 2020, 7:35 PM

                                          Yes, periodic and session backup option was set.

                                          FYI, my file was not a new tab (a.k.a. “New 1”). It was a file that I first created 2 months ago. It’s an old file that I edit daily. But to answer your question: No, under AppData\Roaming\Notepad++\backup and even under the local program file folder Notepad++\backup there are many files, but not that one :(

                                          I am still running Recuva scans with various filters right now… and come to think of it, I now realize I could have had a chance of recovering a very, if not the most, recent version of that file, since I had viewed it in the seconds prior to the power outage, but since I launched Firefox immediately after powering on the computer (after the power outage) the cache2 folder probably was flushed.

                                          E 1 Reply Last reply Jun 15, 2020, 7:40 PM Reply Quote 0
                                          • First post
                                            Last post
                                          The Community of users of the Notepad++ text editor.
                                          Powered by NodeBB | Contributors