csharpextensions icon indicating copy to clipboard operation
csharpextensions copied to clipboard

Can modify the template suffix?

Open wosledon opened this issue 1 year ago • 12 comments

I mentioned an issue earlier #66 is about the case where the template folder is empty.Now I found the reason.

Since the files with the tmpl suffix resemble temporary files in Windows, they were cleaned up when I used some scripts or software to clean junk files.

I think this could be fixed by modifying the template suffix.

wosledon avatar Jul 26 '23 05:07 wosledon

It will be also interesting to know when the templates are deleted. Does it happen randomly?

bard83 avatar Jul 26 '23 06:07 bard83

Well, when I try to use the tool to clean up junk files of C drive as well as cache files, the files with tmpl suffix are also in the cleanup items.

Like a tool named Dism++ or this script

@echo off
echo cleaing...
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo clear!

echo. & pause

wosledon avatar Jul 26 '23 08:07 wosledon

TBH I'd rather tend to say that you should open a bug on the Dism++ repo. It clearly deletes something which is not a temporary file.

bard83 avatar Jul 27 '23 14:07 bard83

I'm guessing that at some point the tmpl suffix might be recognized as a suffix like tmp, or the tmpl suffix would have been in the cleanup list. Because every time I clean up the junk files, the template files are lost.

wosledon avatar Jul 28 '23 00:07 wosledon

You could make an easy test, just creating a couple of tmpl files in some folder (maybe on the same level of the vs code extension), run Dism++ and check whether they are delete or not.

bard83 avatar Jul 28 '23 06:07 bard83

You don't need to use Dism++, the script I wrote above will do it😂😂

wosledon avatar Jul 28 '23 07:07 wosledon

Like a tool named Dism++ or this script

Well probably you should first clarify which one of them deletes the files... shouldn't you?

bard83 avatar Jul 28 '23 07:07 bard83

All, but scripts are a relatively simple way to reproduce.

wosledon avatar Jul 31 '23 07:07 wosledon

The script you sent, deletes from several places. What I suggest is to isolate the instruction which deletes the template files. I cannot do by my self because I'm under linux.

bard83 avatar Aug 08 '23 03:08 bard83

okey...

wosledon avatar Aug 08 '23 08:08 wosledon

I wanted to let you know about removing templates. It will happen and probably you won't struggle anymore. Yet is not clear whether it will be part of the 1.10 or 1.11. Stay tuned.

This extension will be now published here

bard83 avatar Nov 13 '23 10:11 bard83

The reason this happens is that Windows has retained compatibility with file names from MS-DOS, where file names were limited to a 3-character extension.

source: https://superuser.com/a/1644933/914033

I would highly recommend rewrite your script in PowerShell and if possible and an exclusion to Dism++ to prevent deleting the extension template files.

PoLaKoSz avatar Jun 28 '24 06:06 PoLaKoSz