question about temp file naming scheme
Moderators: white, Hacker, petermad, Stefan2
question about temp file naming scheme
if two archives have same file name, and some of its content file also has identical name, TC will exact 2 temporary file in same destination, you either overwrite the previous opened temp file, which may not close or even being locked by other application, or can't open the latter one. If users doesn't notice that, he will pack wrong file back to archive.
step to reproduec:
1. there is a foo.zip in C:\ and a foo.zip in D:\, they has the identical name don't share identical content. But each of them has a bar.txt
2. open C:\foo.zip and then open the bar.txt in the archive by Alt+F3, with external program, says, notepad2
3. open the other D:\foo.zip , the try to open the bar.txt in it, TC prompt dialog asking you to overwrite a temp file or not..
My question is, can this naming scheme improve?
step to reproduec:
1. there is a foo.zip in C:\ and a foo.zip in D:\, they has the identical name don't share identical content. But each of them has a bar.txt
2. open C:\foo.zip and then open the bar.txt in the archive by Alt+F3, with external program, says, notepad2
3. open the other D:\foo.zip , the try to open the bar.txt in it, TC prompt dialog asking you to overwrite a temp file or not..
My question is, can this naming scheme improve?
Re: question about temp file naming scheme
Interesting enough you can compare the two files without TC overwriting anything.
Last edited by petermad on 2019-12-11, 10:15 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
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
- ghisler(Author)
- Site Admin
- Posts: 48083
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: question about temp file naming scheme
Sorry, this cannot be avoided. Some external packers cannot change the name of the unpacked file when unpacking. I could use different directories (which I already do in some cases), but this could potentially clutter the temp folder with thousands of undeleted directories. Therefore I'm using one temporary directory for the left panel and one for the right. This is intentional and will not be changed.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: question about temp file naming scheme
do you mean if I open the above mentionedghisler(Author) wrote: ↑2019-12-11, 07:39 UTC Therefore I'm using one temporary directory for the left panel and one for the right. This is intentional and will not be changed.
c:\foo.zip/bar.txt in left panel
d:\foo.zip/bar.txt in right panel
there will be no overwritting problem? well, but it's not the case, at least not in my win10x64 tc9.5b8 x64. I still got the first temp file overwritten.
and the temp path is
%$LOCAL_APPDATA%\temp\_tc\*.*
I don't see which part associate to left or right panel, i didn't notice it before, but I realized it has nothing to do with the archivers name too. One can't open README in foo.zip and README in bar.zip at the same time while keeping track of which is which.
Last edited by dindog on 2019-12-11, 08:40 UTC, edited 1 time in total.
- ghisler(Author)
- Site Admin
- Posts: 48083
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: question about temp file naming scheme
It depends on what you try to do - TC does separate paths when you use "Compare by content".
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: question about temp file naming scheme
just curious. Why winrar or winzip won't have the problem you bring up?ghisler(Author) wrote: ↑2019-12-11, 08:36 UTC It depends on what you try to do - TC does separate paths when you use "Compare by content".
if i open foo.zip/README then another bar.zip/README, both do some changes, WinRAR will have no problem saving the modified README back to where they were.
well, I was shocked when I realize the only way TC will open two file in different archiver is compare by content.... I rather delete temp file now and then.
Re: question about temp file naming scheme
@ghisler(Author)dindog wrote: ↑2019-12-11, 08:36 UTCdo you mean if I open the above mentionedghisler(Author) wrote: ↑2019-12-11, 07:39 UTC Therefore I'm using one temporary directory for the left panel and one for the right. This is intentional and will not be changed.
c:\foo.zip/bar.txt in left panel
d:\foo.zip/bar.txt in right panel
there will be no overwritting problem? well, but it's not the case, I still got the first temp file overwritten.
and the temp path is
%$LOCAL_APPDATA%\temp\_tc\*.*
As far as I know, TC can use _tc and _tc_ subfolders. Could you always use _tc for the left panel and _tc_ for the right one?
Andrzej P. Wozniak
Polish subforum moderator
Polish subforum moderator
- ghisler(Author)
- Site Admin
- Posts: 48083
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: question about temp file naming scheme
I would have done that long ago if it were that easy.As far as I know, TC can use _tc and _tc_ subfolders. Could you always use _tc for the left panel and _tc_ for the right one?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: question about temp file naming scheme
2ghisler(Author)
Other programs generate subfolders with random names or use C:\full\path\to\archive.zip to generate hash as a subfolder name. The path is unique and so is its hash. Windows from NT family use CRC-32 or similar 4 character hash to generate short names, see short names for newly created dirs below:
Other programs generate subfolders with random names or use C:\full\path\to\archive.zip to generate hash as a subfolder name. The path is unique and so is its hash. Windows from NT family use CRC-32 or similar 4 character hash to generate short names, see short names for newly created dirs below:
Code: Select all
c:\Program Files>dir mic*.* /x /od
Directory: c:\Program Files
2014-05-30 14:47 <DIR> MICROS~1 microsoft frontpage
2017-02-14 07:14 <DIR> MICROS~1.NET Microsoft.NET
2017-02-14 07:22 <DIR> MICROS~3 Microsoft SQL Server
2019-02-01 21:03 <DIR> MICROS~2 Microsoft Silverlight
2019-04-10 06:15 <DIR> MICROS~4 Microsoft XNA
2019-12-11 19:04 <DIR> MI8CC7~1 Microsoft XN
2019-12-11 19:04 <DIR> MIA7C7~1 Microsoft X
2019-12-11 19:04 <DIR> MI3FC7~1 Microsoft Xy
2019-12-11 19:04 <DIR> MI9783~1 Microsoft Xyz
2019-12-11 19:04 <DIR> MIAE83~1 Microsoft Xyzq
2019-12-11 19:04 <DIR> MIDE29~1 Microsoft Xyzqvx
2019-12-11 19:04 <DIR> MI67D3~1 Microsoft Xyzqvxt
Andrzej P. Wozniak
Polish subforum moderator
Polish subforum moderator