Bug or feature? File size does not refresh

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

User avatar
MaxX
Power Member
Power Member
Posts: 1029
Joined: 2012-03-23, 18:15 UTC
Location: UA

Re: Bug or feature? File size does not refresh

Post by *MaxX »

2Dalai
I don't have enough skills in such scripting, sorry. That way is not available for me now. It would be easier just to open 7zFM in background.
Ukrainian Total Commander Translator. Feedback and discuss.
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Bug or feature? File size does not refresh

Post by *Dalai »

  1. Save the code I posted into an AutoIt script file; I named mind FileMetadataUpdate.au3.
  2. Download AutoIt - I recommend the ZIP - and extract it to a directory of your choice.
  3. Start Aut2Exe.exe, point it to the script you saved previously and click "Convert". This will compile the script into an executable in the same directory as the script.
  4. Incorporate the compiled script into TC just like any other program (button, TC start menu, em_ command etc). It expects a single parameter which is the full path to the file in question, i.e. %P%N in TC.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
AntonyD
Power Member
Power Member
Posts: 1249
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Bug or feature? File size does not refresh

Post by *AntonyD »

2Dalai
But more often we need to watch for multiple files. Like, I don't know - like when virus is "eating" in a real-time files - encrypting them totally...
In this case of course watching tool for only ONE file - is not enough. And again - 7zFM could do that! So why not to check its code and incorporate it's best moments into Total?
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Bug or feature? File size does not refresh

Post by *ghisler(Author) »

I have tested 7zFM, but the displayed file size did not change until the download finished (I used Firefox to download a big file).
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Bug or feature? File size does not refresh

Post by *Dalai »

2AntonyD
It's certainly possible to change the script in a way that all files in a directory are opened and closed. But I don't think this is a good idea when dealing with large directories and/or anti-virus software because then it definitely cost performance.

2ghisler(Author)
For me it works. I downloaded a Windows 10 ISO from Microsoft (with browser's user agent set to WinXP so that the page doesn't redirect to the crappy Media Creation Tool instead), opened 7zFM and changed to the directory where Firefox saved the download. 7zFM updated the directory list in regular intervals, maybe once a second. As long as 7zFM was open, TC got the new file size, too. Once 7zFM was closed, the updates stopped. Note that 7zFM has a setting in menu View > Auto Refresh that controls whether or not the directory list is updated automatically. Since the 7-Zip source code is available it should be easy to figure out how it does that.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
MaxX
Power Member
Power Member
Posts: 1029
Joined: 2012-03-23, 18:15 UTC
Location: UA

Re: Bug or feature? File size does not refresh

Post by *MaxX »

2ghisler(Author)
Just leave 7zFM opened in background (but don't minimize it).

Here is how that looks:
https://i.imgur.com/MeuaE1z.gif

I use dx.bat as an example:

Code: Select all

@curl.exe -RLO "https://download.microsoft.com/download/8/4/A/84A35BF1-DAFE-4AE8-82AF-AD2AE20B6B14/directx_Jun2010_redist.exe"
You may use any other download tool, archive packer, video converter/editor. There's no diffrence. We need only NTFS and unknown target file size, as I see.
Ukrainian Total Commander Translator. Feedback and discuss.
User avatar
MaxX
Power Member
Power Member
Posts: 1029
Joined: 2012-03-23, 18:15 UTC
Location: UA

Re: Bug or feature? File size does not refresh

Post by *MaxX »

I hope, that there exist any workaround to make this work.
Ukrainian Total Commander Translator. Feedback and discuss.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Bug or feature? File size does not refresh

Post by *ghisler(Author) »

That's odd, I left 7zFM open in the background during the download, but it did not update. I also switched to 7zFM during another download, and the filze size didn't change until the download was complete. This was with 7zip 23.01 on Windows 11 pro.
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Bug or feature? File size does not refresh

Post by *Dalai »

2ghisler(Author)
Did you enable View > Auto Refresh in 7zFM (which I mentioned above)?
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Bug or feature? File size does not refresh

Post by *ghisler(Author) »

Yes, View - Auto Refresh is checked. Otherwise it wouldn't have updated once the transfer was done.

How often does it refresh? My download was 10 seconds, so if it only happens every half a minute or so, I wouldn't see any refresh.
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Bug or feature? File size does not refresh

Post by *Dalai »

In my case it refreshed about once a second (or every two seconds). Maybe it depends on the Windows version or program used to download a file. Try downloading a file with wget, curl (shipped with Windows 10 1803 and higher) or aria2 (with switch --file-allocation=none so it doesn't preallocate the full file size).

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Mjolnir
Member
Member
Posts: 133
Joined: 2005-10-08, 21:03 UTC

Re: Bug or feature? File size does not refresh

Post by *Mjolnir »

2AntonyD
Dalai is right on large folders... nevertheless, here a folder parsing version of his script
Just run the scrip with "%P" as parameter (don't forget the 2x " )

Code: Select all

#NoTrayIcon
#include <File.au3>
#include <WinAPI.au3>
$Debug = 0

If (Not $CmdLine[0] >= 1) Then _Exit(2,"No path given on command line (try " & '"%P"' & ")")
$localFolder = $CmdLine[1]

$aFileList = _FileListToArray($localFolder, Default, Default, True)
If @error = 1 Then _Exit(1,"Invalid path: " & $localFolder)
If @error = 4 Then _Exit(4,"No file(s) were found in: " & $localFolder)

For $idf = 1 To $aFileList[0]
	$hidf = _WinAPI_CreateFile($aFileList[$idf],2,0,7)
	If $hidf <> 0 Then _WinAPI_CloseHandle($hidf)
	If $Debug Then MsgBox(0,@ScriptName,$idf & " / " & $aFileList[0] & @CR & "File metadata updated for: " & $aFileList[$idf] & @CR & FileGetSize($aFileList[$idf]) & " bytes")
Next
If $Debug Then _Exit(0,"Processed: " & $aFileList[0] & " file(s)")

Func _Exit($id = 0, $tkn = "")
	MsgBox(0,@ScriptName,"Exit (" & $id & ")" & @CR & $tkn)
	Exit($id)
EndFunc
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
Post Reply