Notepad3: [Request] Preserve file modified time when saving

Created on 21 Aug 2019  ·  26Comments  ·  Source: rizonesoft/Notepad3

Hello,

I wonder if Notepad3 can preserve file modified time when saving a file, as in keeping the file's created time as modified time.

I find this very helpful when editing old batch files to generate log files. When sorted in an Explorer window, the newly edited batch files doesn't get in the way of the log files themselves.

Akelpad has a similar feature but sadly it is no being actively developed.

Thank you.

enhancement / feature req. question

Most helpful comment

Okay, to simplify things: Everything as before, except:
If Save with Original Date/Time is used once in the current session, all further file save operations are using this "Preserve" option. If the Preserve-Option is ON, the menu Save with Original Date/Time entry gets a check-mark. The Preserve-Option can not be toggled, only be reset by requesting a new session (New File or File Reload (F5)).
Hope this fits your workflow.
(Shall this option be protected by an warning dialog, which can be switched to be quiet?)

Feel free to test dev beta ver _5.19.905.2619_BETA.
@hpwamr : No need to change the menu string ... :grin:

All 26 comments

Hello @Hippobotus ,
Short answer is "No".
But there are plenty of free Apps to easily change individually or in batch: "Created Date/Time", "Modified Date/", "Accessed Date/Time"

Here a few Apps:

  • Attribute Changer (ATTRIBUTES, DATE AND TIME: Modify system attributes and manipulate date and time of files and folders with endless possibilities)
  • Free File Attribute Changer (The Application changes Date and Time attributes of a file or multiple files)
  • NewFileTime (NewFileTime is a Windows tool that provides you easy access to correct or manipulate any of the timestamps for any file and folder on your Windows system)

Hello hpwamr,

Thank you for the quick reply. I will take a look at the suggested apps to see how I can incorporate them into my work-flow.

Cheers!

I wonder if Notepad3 can preserve file modified time when saving a file, as in keeping the file's created time as modified time.

Hello @RaiKoHoff ,
Do you think this is a desirable and/or possible development?

I think this is a valid addition to np3.
Always necessary in professional text editing utilities.

I'd like to chime in here.

I have to admit that this is not a functionality which natively belongs into a text editor as it comes from another domain. So I understand the hesitation here as NP3 should remain slim and focused to its core tasks.

But I also have to admit that I have the same problem myself quite often – I regularly perform some "minor" changes to certain files (e.g. scripts) which do not change their meaning/logic/behavior (for example pure typo corrections in comments). In this case I reset the file modification date after the change to signal that the "main content" actually has an older validity date.

This is a very specific use case of course. So while I certainly would welcome the possibility to make changes to files with NP3 without actually changing their modification date, I would also very well understand a "no" regarding this feature request.

Remark: it should be noted that this feature could also have serious implications if users are not aware of its side effects. For example there are backup programs which for performance reasons only consider the modification date (and maybe size and/or attributes) of a file as criterion whether to backup it up or not (i.e., whether it represents a new version or not). In case of file modifications without changes to the date this could fail and the user unexpectedly would not have the most recent content of a file saved.

So should this feature be realized, I suggest to have it disabled by default, with the user being required to explicitly turn it on.

Always necessary in professional text editing utilities.

o while I certainly would welcome the possibility to make changes to files with NP3 without actually changing their modification date

So should this feature be realized, I suggest to have it disabled by default, with the user being required to explicitly turn it on.

Yes, you make positive points. 👍
Let's see what @RaiKoHoff thinks about this ? 🤔

Feel free to test development beta version _5.19.827.2599_BETA.
(beta channel access see #1129)

  • Menu: File->Preserve File Modification Time

(suggestions for better wording are always welcome)

Hello @Hippobotus , @ShadyGaDa , @engelhro
Please, test and comment... 😉

2019-08-27_225548

Feel free to test the BETA version "Notepad3Portable_5.19.827.2601_BETA" or higher.
See "Notepad3 BETA-channel access #1129" or download it from Notepad3Portable_5.19.827.2601_BETA.

Hello,

It is a pleasant surprise to see this suggestion picked up. Please excuse me for not noticing this sooner.

The feature works well and as suggested on the comments above, it is perfect as a one-off non-permanent use.

If anything, it would be easier on the workflow if this new feature was added as part of 'Save' commands on the 'File' menu and able to save with a hotkey.

For example:

  • Menu: File -> Save with original File Date Ctrl+Alt+S

Once again, thank you @RaiKoHoff and @hpwamr.

Cheers!

If anything, it would be easier on the workflow if this new feature was added as part of 'Save' commands on the 'File' menu and able to save with a hotkey.
Menu: File -> Save with original File Date Ctrl+Alt+S

Hello @Hippobotus , @ShadyGaDa , @engelhro , @RaiKoHoff ,

What do you think of this change:

  • Menu: File --> "Save with Original File Date/Time" instead of "Preserve File Modification Time" --> Ctrl+Alt+F6 or Ctrl+Shift+F6

We are very short with "HotKey's"

  • Ctrl+Alt+S is already use for Edit --> Convert --> Untabify Indent
  • Maybe --> Ctrl+Alt+F6 or Ctrl+Shift+F6

Alt+F6 is free too ;-)

Hello @hpwamr and @RaiKoHoff,

I'm ok with the suggestions - wordings and the hotkeys.

Any one of them is fine, with a slight preference for the 1st one.

  • Ctrl+Alt+F6
  • Ctrl+Shift+F6
  • Alt+F6

Cheers!

If I understand correctly, this should not be an persisted option (like the current implementation), but an additional command like the "Save" (Ctrl+S) (preserving the modification timestamp)?

If I understand correctly, this should not be an persisted option (like the current implementation), but an additional command like the "Save" (Ctrl+S) (preserving the modification timestamp)?

Menu: File --> "Save with Original File Date/Time" instead of "Preserve File Modification Time" --> Ctrl+Alt+F6 or Ctrl+Shift+F6 or Atl+F6

This is my preference with Alt+F6 ! 🤔 😃

Feel free to test dev beta ver _5.19.902.2613_BETA.
(@hpwamr : too late :asterisk:, implemented Ctrl+Alt+F6 - needs adaption for other languages, except en-US, en_GB, de-DE)

Hello @hpwamr and @RaiKoHoff,

I have been trying out the new feature and I am happy to report that it is working as intended and there are no problems so far.

Cheers!

Hello @Hippobotus , @ShadyGaDa , @engelhro ,
Did you try the new implementation in the latest beta: v_5.19.903.2616_BETA 🤔

Feel free to test the BETA version "Notepad3Portable_5.19.903.2616_BETA" or higher.
See "Notepad3 BETA-channel access #1129" or download it from Notepad3Portable_5.19.903.2616_BETA.

As far as I am concerned, this issue may be closed....

Hello @hpwamr and @RaiKoHoff,

Did you try the new implementation in the latest beta: v_5.19.903.2616_BETA

Yes, I did. No issues at all.

As far as I am concerned, this issue may be closed....

Again yes, this is basically done.

Thanks for helping out with this feature request. =]

Notepad3_2019_09_05_001

Hello,

I've just tested the new feature (with beta 5.19.904.2617).

If I understand correctly, this should not be an persisted option (like the current implementation), but an additional command like the "Save" (Ctrl+S) (preserving the modification timestamp)?

Actually, I'd prefer the other solution, with a permanent setting, or even better one that lasts just as long as I have a certain document open (similar to the file change notification which can be reset when opening another document).

Reason:
While editing a document I'm used to save quite often (you never know…). And as soon as I forget to use the new hotkey to save with the original date and hit the regular CTRL + S instead (which is what most users are used to I guess), the original timestamp is lost…

So "remapping" the regular file save action to the one which keeps the timestamp while I have the document open and activated the "keep timestamp" option would be the most convenient solution, at least for me. What do you think?

Hello @RaiKoHoff
I propose to have the two solutions:

  • Save with Original File Date/Time for @Hippobotus
  • Preserve File Modification Date/Time for @engelhro
    (if possible, activation only for the open file ? or only for open session ?)

So a solution would be:
Having both: Save on demand (Ctrl+Alt+F6) saves the file (preserving File Date/Time) and triggers a "Preserve File Date/Time Sticky Option" for this session, so that future Ctrl+S events will preserve the File Date/Time for this session (until closed or new file is loaded or same file is reloaded).
This option will not be persisted in the .ini-file, as it will be per session only. (Think this would be the first per session option - oh no, "Change File Notification" has a "Reset on new file check-box" :thinking:) ...

Okay, to simplify things: Everything as before, except:
If Save with Original Date/Time is used once in the current session, all further file save operations are using this "Preserve" option. If the Preserve-Option is ON, the menu Save with Original Date/Time entry gets a check-mark. The Preserve-Option can not be toggled, only be reset by requesting a new session (New File or File Reload (F5)).
Hope this fits your workflow.
(Shall this option be protected by an warning dialog, which can be switched to be quiet?)

Feel free to test dev beta ver _5.19.905.2619_BETA.
@hpwamr : No need to change the menu string ... :grin:

@RaiKoHoff: Just tested that beta and I have to say I'm very pleased! 👍 Fits my workflow perfectly!

I think that implementation is a very reasonable approach, easy to understand and use. I have no preference regarding the warning dialogue, but maybe it is a good idea to have one shown once for users not aware of that feature.

So at least I'm fine now with the current solution 🙂.

Hello @Hippobotus ,
As far as I'm concerned, I think you (as requester) can close this issue...

Hello @Hippobotus, @RaiKoHoff

Thanks once again. Pardon for the delay, closing now. =]

I didn't realise it at the time, but I'm finding this feature really useful. Thanks.

Was this page helpful?
0 / 5 - 0 ratings