one corner case where npp doesn't warn about "{file} doesn't exist anymore"
-
@mm-john said in one corner case where npp doesn't warn about "{file} doesn't exist anymore":
and doing it in the npp file-open dialog is convenient
I used to do that, but at some point I started to make use of File commands “Save a Copy As…” and Rename (latter also in tab right-click) which feel a bit safer because they’re not “sneaky”, ie, outside NPP’s awareness.
-
@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.
-
@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.
-
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-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-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.
-
@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.
-
@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
-
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.
-
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.
-
@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.