Hello,
Is there a way to clear the Folder Size Cache each time I exit/close XYplorer?
Thank you
Clear Folder Size Cache On Exit
Re: Clear Folder Size Cache On Exit
Configuration | General | Custom Event Actions
Other Events
Exit
Action = Run script
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; }
One of my scripts helped you out? Please donate via Paypal
Re: Clear Folder Size Cache On Exit
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
You would get an access denied message box every time you save settings / exit XY
One of my scripts helped you out? Please donate via Paypal
Re: Clear Folder Size Cache On Exit
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
Wouldn't work as well, the 
fsc.dat is saved regardless if you disable the save settings on exit One of my scripts helped you out? Please donate via Paypal
Re: Clear Folder Size Cache On Exit
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.
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
Yeah, I‘ve tried it before I wrote the script
One of my scripts helped you out? Please donate via Paypal
Re: Clear Folder Size Cache On Exit
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
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
1023 = all
I find the behaviour of
savesettings strange as well.1023 = all
savesettings 1023; = No fsc.dat is createdsavesettings; = fsc.dat is createdOne of my scripts helped you out? Please donate via Paypal
-
admin
- Site Admin
- Posts: 64916
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Clear Folder Size Cache On Exit
fsc.dat is written only if the cache is dirty (if it is assumed to be different from the contents of fsc.dat).
FAQ | XY News RSS | XY X
XYplorer Beta Club