Page 1 of 1

Clear Folder Size Cache On Exit

Posted: 17 Jun 2025 20:06
by virtualrab
Hello,
Is there a way to clear the Folder Size Cache each time I exit/close XYplorer?
Thank you

Re: Clear Folder Size Cache On Exit

Posted: 17 Jun 2025 20:38
by highend
Configuration | General | Custom Event Actions
Other Events
Exit

Action = Run script

Code: Select all

    $batFile    = "%TEMP%\~xy_delete_fsc.bat";
    $batContent = <<<>>>
@echo off
:CheckProcess
tasklist | findstr /i "xyplorer.exe" >nul 2>&1
if %ERRORLEVEL% == 0 (
    timeout /t 2 >nul
    goto CheckProcess
)
timeout /t 2 >nul
del /f /q "<xydata>\fsc.dat"
    >>>;
    $result = writefile($batFile, $batContent, , "utf8");
    if ($result != 0) { run lax("cmd" /c "$batFile"), "%TEMP%", 0, 0; }

Re: Clear Folder Size Cache On Exit

Posted: 18 Jun 2025 21:05
by jupe
Theoretically, I think if you just make the fsc.dat file read only it will perform as you wish (session only cache), empty its contents too if desired, so it is 0 bytes.

Re: Clear Folder Size Cache On Exit

Posted: 18 Jun 2025 21:35
by highend
You would get an access denied message box every time you save settings / exit XY

Re: Clear Folder Size Cache On Exit

Posted: 18 Jun 2025 21:42
by jupe
Ah ok, I hadn't tested the theory, another theory then to workaround that is you could instead set a cea exit event that used SC savesettings to only save the files you wanted, and disable the main config setting.

Re: Clear Folder Size Cache On Exit

Posted: 18 Jun 2025 22:03
by highend
Wouldn't work as well, the fsc.dat is saved regardless if you disable the save settings on exit :)

Re: Clear Folder Size Cache On Exit

Posted: 18 Jun 2025 22:42
by jupe
Are you sure?

I don't use Folder Sizes so am not that familiar with the dynamics, but from memory of testing I think you are mistaken.

Re: Clear Folder Size Cache On Exit

Posted: 18 Jun 2025 22:47
by highend
Yeah, I‘ve tried it before I wrote the script

Re: Clear Folder Size Cache On Exit

Posted: 18 Jun 2025 23:00
by jupe
Strange, after a quick test I can't confirm fsc.dat getting saved when the main save settings on exit config option is disabled, but maybe there are other factors at play.

Re: Clear Folder Size Cache On Exit

Posted: 18 Jun 2025 23:09
by highend
Very strange, I've tried it several times with 0700 and it saved the file cache each time with save settings on exit disabled...

I find the behaviour of savesettings strange as well.

1023 = all
savesettings 1023; = No fsc.dat is created
savesettings; = fsc.dat is created

Re: Clear Folder Size Cache On Exit

Posted: 20 Jun 2025 16:03
by admin
fsc.dat is written only if the cache is dirty (if it is assumed to be different from the contents of fsc.dat).