File in archive doesn't open when directory name in path contains blank at the end

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Stefan2, Hacker, petermad

Post Reply
argh0815
Junior Member
Junior Member
Posts: 16
Joined: 2016-11-24, 17:42 UTC
Location: Singapore

File in archive doesn't open when directory name in path contains blank at the end

Post by *argh0815 »

I have enabled the option "Treat archives like directories". If a path structure in an archive (tested with zip and 7z) contains a directory name with a space at the end, files within that directory don't open when double-clicked but below error message is shown. The archive contains a directory "Test " and within that directory a pdf "Test Document.pdf". If I remove the trailing blank of the directory name, opening the file works. Happens with 11.57 as well as 11.58rc1.

Image: https://imgur.com/a/IUqDwli
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53139
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: File in archive doesn't open when directory name in path contains blank at the end

Post by *ghisler(Author) »

This happens because Windows doesn't support spaces in file extensions. "pdf " wouldn't be associated with anything anyway.

Moderator message from: ghisler(Author) » 2026-05-31, 10:36 UTC

Moved to will not be changed
Author of Total Commander
https://www.ghisler.com
argh0815
Junior Member
Junior Member
Posts: 16
Joined: 2016-11-24, 17:42 UTC
Location: Singapore

Re: File in archive doesn't open when directory name in path contains blank at the end

Post by *argh0815 »

Thanks for the feedback. It's not the extension that has a blank at the end, it's the directory name within the archive, i.e., the path within the archive is "Test \Test Document.pdf". If I remove the trailing blank from "Test " it works, the path is then "Test\Test Document.pdf".
User avatar
white
Power Member
Power Member
Posts: 6940
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: File in archive doesn't open when directory name in path contains blank at the end

Post by *white »

ghisler(Author) wrote: 2026-05-31, 10:36 UTC This happens because Windows doesn't support spaces in file extensions. "pdf " wouldn't be associated with anything anyway.
?
Perhaps you meant: It's because TC tries to create a folder named "Test " in the temp folder, which results in Windows creating the folder "Test" without trailing space instead. And subsequently, TC tries to extract the file to a non-existing folder.
argh0815
Junior Member
Junior Member
Posts: 16
Joined: 2016-11-24, 17:42 UTC
Location: Singapore

Re: File in archive doesn't open when directory name in path contains blank at the end

Post by *argh0815 »

white wrote: 2026-05-31, 11:24 UTC It's because TC tries to create a folder named "Test " in the temp folder, which results in Windows creating the folder "Test" without trailing space instead. And subsequently, TC tries to extract the file to a non-existing folder.
That explains it, thanks!
Post Reply