When using reverse date sorting (my default), deleting contents inside folders causes them to end up on top, although there is no benefit in this, on the contrary, it's confusing, harms the visual assessment and structuring of viewed or processed content (media and documents) and you often have to spend extra time checking useful changes (creating/modifying).
The suggested option will fix this problem. For example: RestoreDirDateAfterDeletingContent=0/1
Option: restore parent folder date after deleting (or moving from it) content
Moderators: white, Hacker, petermad, Stefan2
Option: restore parent folder date after deleting (or moving from it) content
Last edited by Fla$her on 2024-04-17, 13:54 UTC, edited 2 times in total.
Overquoting is evil! π
Re: Option: don't update the folder date when deleting (or moving from) content
It's not TC which updates directory timestamps but Windows or the underlying file-system. As soon as directory contents are changed (file added, removed) the timestamp changes. Check with other file-managers, Explorer or CMD and you will see the same thing.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: Option: don't update the folder date when deleting (or moving from) content
It doesn't matter. We have the CopyDirTimeStamp and CopyAllTimes options that control the change of timestamps when copying, the same can be done for folders when deleting/moving from them, restoring the previous date, especially since TC has its own deletion mechanism when Win95Delete=0 and VistaDelete=0.
Overquoting is evil! π
Re: Option: don't update the folder date when deleting (or moving from) content
Hmm, it seems to me that the title of this topic should rather be: "Restore folder date after deleting (or moving) content".
It could be nice as an option, but should maybe also include adding files.
It could be nice as an option, but should maybe also include adding files.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Option: restore parent folder date after deleting or moving content
OK. Changed.
If the copy and move commands had such an option for a target folder, then it would make sense. But saving the date of any folder for any changes is no less a problem than I described.but should maybe also include adding files.
Overquoting is evil! π
Re: Option: restore parent folder date after deleting (or moving from it) content
I also did it on AutoIt, but not so much for the button as for reassigning Del and Shift + Del for the current delete command, restoring the date so far only in regular folders.
It's not recommended to create or modify items in a folder during a background operation.
DeleteWithSavingParentDirDate.au3
Code: Select all
;ββββββββββββββββββββββββββββββββββββ AU3 ββββββββββββββββββββββββββββββββββββ
; Purpose: Delete content with saving parent folder date
; Advice: Bind em_DeleteWithSavingParentDirDate to Delete and Shift+Delete
; Parameters: %S1:~,0
;βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
#NoTrayIcon
$hWnd = WinGetHandle('[ACTIVE]')
If DllCall('user32.dll','int','GetClassName','hwnd',$hWnd,'str','','int',4095)[2] <> 'TTOTAL_CMD' Then Exit
$sPanel = _GetInfo(1000)
Global $sCount = _GetInfo(1004 + $sPanel), $Type = 'Post'
If $sCount = 0 And _GetInfo(1008 + $sPanel) = 1 And _GetInfo(1006 + $sPanel) = 0 Then Exit
$Dir = StringRegExpReplace(ControlGetText($hWnd,'', _GetInfo(8 + $sPanel)),'\\[^\\]+$','')
$IsDir = FileExists($Dir & '\')
If $IsDir Then $Type = 'Send'
If StringLen($Dir) > 2 And $IsDir = 1 Then
If $sCount = 0 Then $sCount = 1
$MDate = FileGetTime($Dir, 0, 1)
Global $DSize = DirGetSize($Dir, 1), $iCount = $DSize[1] + $DSize[2], $NDate, $LDate, $lCount
$rCount = $iCount - $sCount
EndIf
DllCall('user32.dll','int',$Type & 'Message','hwnd',$hWnd,'uint',1075,'wparam',908,'lparam',0)
If IsDeclared('MDate') Then
While $rCount < $iCount
Sleep(500)
$DSize = DirGetSize($Dir, 1)
$iCount = $DSize[1] + $DSize[2]
If $iCount = $lCount Then ExitLoop
$lCount = $iCount
Wend
$NDate = $MDate
While $LDate <> $NDate
$LDate = $NDate
FileSetTime($Dir, $MDate)
Sleep(1000)
$NDate = FileGetTime($Dir, 0, 1)
Wend
If $MDate <> $NDate Then FileSetTime($Dir, $MDate)
Sleep(1000)
If $MDate <> FileGetTime($Dir, 0, 1) Then FileSetTime($Dir, $MDate)
EndIf
Func _GetInfo($i)
Return DllCall('user32.dll','handle','SendMessage','hwnd',$hWnd,'uint',1074,'wparam',$i,'lparam',0)[0]
EndFunc
Overquoting is evil! π