FarManager
FarManager copied to clipboard
LuaMacro plugin: Enable win.GetFileTimes/win.SetFileTimes to get/set change time
Description of the new feature or improvement
The Lua function win.GetFileTimes
returns Creation time, Last access time, and Last write time as shown in the following code. It does not return Change time.
https://github.com/FarGroup/FarManager/blob/2326d88085452dde8658d561f200ee3295a5a0ea/plugins/luamacro/luafar/win.c#L863-L870
Similarly, win.SetFileTimes
sets the same time values as shown in the following code. It does not set Change time.
https://github.com/FarGroup/FarManager/blob/2326d88085452dde8658d561f200ee3295a5a0ea/plugins/luamacro/luafar/win.c#L917-L923
Could you please add support for getting and setting Change time as well? This would allow Lua macros to set and restore all file times, similar to the Preserve all timestamps feature in the Copy and Rename/Move dialogs.
Proposed technical implementation details (optional)
Use file::GetTime
and file::SetTime
instead of GetFileTime
and SetFileTime
respectively.
https://github.com/FarGroup/FarManager/blob/2326d88085452dde8658d561f200ee3295a5a0ea/far/platform.fs.hpp#L258-L260
@shmuz
@johnd0e, as you know I'm spending all my spare time nowadays on far2m, etc. and there's no ChangeTime
there.
@shmuz, yes I know. But still hope that some day you will be able to find some time. Or at least give us your opinion about proposed implementation.
- It's not a proposed implementation here, it is just a suggestion to use the same code Far3 uses.
- I respect you being a Far3 "patriot", but on the other hand you could help me a lot with far2m but you won't do that.
you could help me a lot with far2m but you won't do that.
I will be happy to help where I can. At the moment I have no system where I could run far2m.
@johnd0e Thank you for trying to get this issue resolved.
- It's not a proposed implementation here, it is just a suggestion to use the same code Far3 uses.
@shmuz The suggestion and the proposed implementation are the same, i.e. to use different functions, ones that get/set 4 file times instead of 3. I'd be happy to submit a patch if someone can review and commit it.
@rohitab
I'd be happy to submit a patch if someone can review and commit it.
It seems to be the right way. It won't guarantee immediate review and commit but the chances would be much higher.