(Solved) TC10 creates temp files on lister plugin usage

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
deus-ex
Power Member
Power Member
Posts: 969
Joined: 2003-02-10, 17:45 UTC

(Solved) TC10 creates temp files on lister plugin usage

Post by *deus-ex »

@ghisler(Author)

I just noticed that TC10 creates a temp file when using a lister plugin. These temporary files last for the entire session of TC. Generally nothing against using temp files, but these temp files are created each at the location of the respective lister plugin in use. This also causes the timestamp of the plugin folder to be updated. This is not a good solution, system temp folders exist for a reason. Please fix this behavior immediately.

EDIT: Also a temp file is generated in the attempt to copy a file into a lister plugin folder, e.g. when trying to manually update a lister plugin. The creation of the temp file prevents updating the lister plugin file, even right after a restart of TC.
Last edited by deus-ex on 2021-03-18, 20:05 UTC, edited 1 time in total.
User avatar
petermad
Power Member
Power Member
Posts: 14796
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: TC10 creates temp files on lister plugin usage

Post by *petermad »

I also find this highly annoying. :(

I have so far only seen it with Lister and Packer plugins, and not with all of them, just some.
Last edited by petermad on 2021-03-12, 09:59 UTC, edited 1 time in total.
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
User avatar
Stefan2
Power Member
Power Member
Posts: 4155
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: TC10 creates temp files on lister plugin usage

Post by *Stefan2 »

How about an option to use an TC-own temp folder, (if the TC folder is writeable)
instead of the system temp folder (only use this if need)?

d\
e\
LANGUAGE\
Log\
plugins\
temp\


Or an new wincmd.ini parameter:
TempPath=%Commander_Path%\temp




 
User avatar
deus-ex
Power Member
Power Member
Posts: 969
Joined: 2003-02-10, 17:45 UTC

Re: TC10 creates temp files on lister plugin usage

Post by *deus-ex »

@Stefan2

I just noticed your COVID19 hardened avatar and it made me smile. Loving it. :)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC10 creates temp files on lister plugin usage

Post by *ghisler(Author) »

Strange, I delete this file immediately after creating it. I also use flags "temporary" and "delete on close". The file checks whether the plugin directory is writable. If not, I redirect all calls to CreateFileA/W and all ini file functions to my own, which then redirect file access to the user profile. I do this because I now default to "Program Files\totalcmd" when installing, and many older plugins write to their directory and fail in this case.
Author of Total Commander
https://www.ghisler.com
User avatar
deus-ex
Power Member
Power Member
Posts: 969
Joined: 2003-02-10, 17:45 UTC

Re: TC10 creates temp files on lister plugin usage

Post by *deus-ex »

@ghisler(Author)

Here these temp files remain active/unremovable the entire session of TC. And they hinder me from updating Lister plugins, even directly after restarting TC because a temp file is created immediately on the copy attempt. Please find another solution, the way it is now is unacceptable.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC10 creates temp files on lister plugin usage

Post by *ghisler(Author) »

Which Windows version do you use? TC 32-bit or 64-bit?
Author of Total Commander
https://www.ghisler.com
User avatar
deus-ex
Power Member
Power Member
Posts: 969
Joined: 2003-02-10, 17:45 UTC

Re: TC10 creates temp files on lister plugin usage

Post by *deus-ex »

Windows 10 Pro 64-bit 20H2 (official build 19042.867) and TC 64-bit, with TC 32-bit files available in the same directory for running old plugins that are only available in 32-bit.

EDIT: I should add that I always run TC with Admin rights, and Windows UAC is disabled (too annoying).
User avatar
petermad
Power Member
Power Member
Posts: 14796
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: TC10 creates temp files on lister plugin usage

Post by *petermad »

And I use Window 7 sp1 with both 32 and 64 TC - and have the same problem. I don't run TC with Admin right and I have standard UAC setting.

It is only in some plugin directories I see this - do you want a list over which plugins it is?
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
User avatar
deus-ex
Power Member
Power Member
Posts: 969
Joined: 2003-02-10, 17:45 UTC

Re: TC10 creates temp files on lister plugin usage

Post by *deus-ex »

ghisler(Author) wrote: 2021-03-12, 15:09 UTCThe file checks whether the plugin directory is writable. If not, I redirect all calls to CreateFileA/W and all ini file functions to my own, which then redirect file access to the user profile. I do this because I now default to "Program Files\totalcmd" when installing, and many older plugins write to their directory and fail in this case.
Further thinking about this issue, perhaps the simplest solution is to add a config key that allows disabling this functionality.
User avatar
Dalai
Power Member
Power Member
Posts: 9388
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: TC10 creates temp files on lister plugin usage

Post by *Dalai »

2deus-ex
As per the TC 10 beta announcement, RestrictInterface has a new value 8192 to disable this feature. However, I'm still not sure if it's a good idea. It requires administrators to set this value when they set NTFS permissions on select plugin settings files and leave others read-only on purpose. Otherwise TC will try to create a plugin settings file, but will fail to do so, despite the plugin being able to save its settings (if permissions allow it)...

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
deus-ex
Power Member
Power Member
Posts: 969
Joined: 2003-02-10, 17:45 UTC

Re: TC10 creates temp files on lister plugin usage

Post by *deus-ex »

@Dalai

Thanks for the heads-up. I didn't fully realize that this would disable the necessity for TC to create temp-files in the plugin folders.
Also, there is this new feature which should help to fix any plugin-ini-writing issues:

Code: Select all

07.03.21 Added: wincmd.ini, new section [ReplaceIniLocation]: Change location of ini file settings each plugin uses, via line pluginfile.ext=c:\path\newinifile.ini (32/64)
User avatar
deus-ex
Power Member
Power Member
Posts: 969
Joined: 2003-02-10, 17:45 UTC

Re: TC10 creates temp files on lister plugin usage

Post by *deus-ex »

2ghisler(Author)

I have been successfully using the ini-file directive 'RestrictInterface=8192' to prevent the creation of the temp files in the plugin folders. With the release of Total Commander 10 beta 2, this is no longer necessary due to this change:

Code: Select all

15.03.21 Fixed: When loading plugins, use function AccessCheck to check whether the plugin directory is writeable instead of creating a temporary file (32/64)
Many thanks to you, Christian, for developing a different and satisfying solution, that does not interfere with the filesystem in the manner the previous method did.
User avatar
petermad
Power Member
Power Member
Posts: 14796
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: TC10 creates temp files on lister plugin usage [solved]

Post by *petermad »

Yes, confirmed fixed in TC 10 b2 - Thanks for fixing this :-)
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
Post Reply