Community
    • Login

    one corner case where npp doesn't warn about "{file} doesn't exist anymore"

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    13 Posts 5 Posters 1.1k 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.
    • MM-JohnM
      MM-John @Neil Schipper
      last edited by

      @neil-schipper Absolutely that’s an option. But that file has today’s date, not the original date of the file. For me that’s an important distinction.

      1 Reply Last reply Reply Quote 0
      • MM-JohnM
        MM-John @Neil Schipper
        last edited by

        @neil-schipper Also, another alternative is File - Rename to backup file name. Then File -> save_as to original file name. That’s equivalent to what I’m doing. I find the file - open easier, but they’re close.

        Alan KilbornA 1 Reply Last reply Reply Quote 0
        • Alan KilbornA
          Alan Kilborn @MM-John
          last edited by Alan Kilborn

          @mm-john

          I understand the complaint. You should make a real issue out of it; see instructions HERE.

          As to your workflow, if your intent is to make a backup, why wouldn’t you copy the file to a new name rather than renaming it? You could even do this right in the File > Open dialog, as an alternative to the renaming operation you are doing now. This would seem to solve your problems (in the context of your workflow – it doesn’t solve anything about the issue with N++).

          Alan KilbornA 1 Reply Last reply Reply Quote 1
          • Alan KilbornA
            Alan Kilborn @Alan Kilborn
            last edited by Alan Kilborn

            @alan-kilborn said :

            why wouldn’t you copy the file to a new name

            Maybe I should be explicit in this procedure since it is arguably a little less obvious than renaming in the Open dialog:

            • Do File > Open
            • Locate and click on file to backup (example test.txt)
            • Press Ctrl+c
            • Press Ctrl+v

            Windows will create a new file (example: test.txt - Copy) – with the same timestamp as the original – and show it to you in the directory listing.
            Rename THAT file as you like.

            MM-JohnM 1 Reply Last reply Reply Quote 2
            • mpheathM
              mpheath
              last edited by

              @mm-john said in one corner case where npp doesn't warn about "{file} doesn't exist anymore":

              …
              So, as I said, this is a corner case. I don’t expect anyone to fix it, I just thought it ought to be documented.
              …

              The Open and Save Dialogs are blocking functions. All programs that call these functions will wait for the result to be returned. This is why you cannot interact with Notepad++ while the dialog is open, else you may get the not responding message if it were not disabled as Notepad++ is in a blocked state. This blocked state is probably causing the detection of the file state not to be done as Notepad++ is doing no processing at that time.

              Modifying files while in these dialogs is what I would not recommend, as you have discovered with doing something unexpected during the task. This applies to any program that calls these dialog functions.

              Alan KilbornA 1 Reply Last reply Reply Quote 1
              • Alan KilbornA
                Alan Kilborn @mpheath
                last edited by

                @mpheath said in one corner case where npp doesn't warn about "{file} doesn't exist anymore":

                Modifying files while in these dialogs is what I would not recommend, as you have discovered with doing something unexpected during the task.

                This is a good recommendation, although, in the end, Notepad++ really bears the responsibility to have a “smart” reaction when users do “dumb” things.

                1 Reply Last reply Reply Quote 0
                • MM-JohnM
                  MM-John @Alan Kilborn
                  last edited by

                  @alan-kilborn Copying a file (in windows) preserves its Date modified (LastWriteTime) but it changes its Date created (CreationTime).

                  Rename does not change the Date created (CreationTime).

                  Both operations, however, change the Date accessed (LastAccessTime)

                  This gif illustrates in windows explorer: https://postimg.cc/N54cMZSh

                  Alan KilbornA 1 Reply Last reply Reply Quote 0
                  • Alan KilbornA
                    Alan Kilborn @MM-John
                    last edited by Alan Kilborn

                    @mm-john

                    OK, not sure why you’re so particular about the timestamps (but you keep being you :-) ). I don’t really care to pursue further about that, as we’re moving into “off topic” land…

                    My diversion with the Ctrl+c/Ctrl+v thing was to point out how to create a copy of a file without changing its “modified” timestamp (the timestamp that means the most to ME). As noted, Save As and Save a Copy As both change this timestamp.

                    The relevant point was your main point in the first posting in this thread. I’ve recommended that you create an issue about that, so that’s all I’ve got.

                    1 Reply Last reply Reply Quote 0
                    • Pierre McGrailP
                      Pierre McGrail
                      last edited by

                      There is an option in MISC. that do exactly what I think OP needed. Just select ‘Enable for all opened files’ in ‘File Status Auto-detection’. Definitely what I need for case when file are also managed externally and sometimes gets renamed/deleted. My problem was hitting ‘save all’ in NP++ and all the files were rewritten on drive without giving me chance with the usual “Keep file in editor” dialog that we see when changing focus to this file.

                      Neil SchipperN 1 Reply Last reply Reply Quote 0
                      • Neil SchipperN
                        Neil Schipper @Pierre McGrail
                        last edited by

                        @Pierre-McGrail I was able to replicate OP’s issue with npp.8.4.9.portable.x64, so the option you mention, while very helpful in many situations, does not eliminate the problem.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors