FileName Extension Bug

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Rynsrod
Junior Member
Junior Member
Posts: 7
Joined: 2009-04-27, 05:22 UTC
Contact:

FileName Extension Bug

Post by *Rynsrod »

I was Create Text File from TC with hot Keys Ctrl+F4 and give name just "123".
I use FAR as external file editor like that and invoke them as follows:
"FAR\far.exe" /e "%1"

As a result I have 2 file on disk:

Code: Select all

123 ( with Zero FileSize),
123. (123[dot]) (with my file size)
After that I can't delete second file by Nothing.
Only FAR could remove it.

I not sure maybe this is Bug of Far but I didn't find this problem before TC7.5 and higher.

Thank you for attention.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

That's strange because in Windows names "123" and "123." are the same! So they must point to one file. Maybe your FAR made that file and kept it opened so no one else couldn't remove it?
Rynsrod
Junior Member
Junior Member
Posts: 7
Joined: 2009-04-27, 05:22 UTC
Contact:

Post by *Rynsrod »

MVV wrote:That's strange because in Windows names "123" and "123." are the same! So they must point to one file. Maybe your FAR made that file and kept it opened so no one else couldn't remove it?
That is really strange but when I try to remove this TC says
"File C:\123. not found!"
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

MVV wrote:That's strange because in Windows names "123" and "123." are the same! So they must point to one file. Maybe your FAR made that file and kept it opened so no one else couldn't remove it?
FAR has some workarounds especially to remove such a wrong names like this.
You can read here (in russian) that FAR is a one of suggested tools for such cases.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Well, it seems that TC on Shift+F4 created file 123 and passed name to editor, and FAR created file really with dot in name. It is strange why FAR created a file with dot in name when you ask for edit file without it.

BTW as I see TC passes to editor name with dot at the end (maybe to indicate that file have no extension). Anyway it is a FAR bug that it created file with dot in the name instead of creating just file without extension. :)

DrShark wrote:You can read here (in russian) that FAR is a one of suggested tools for such cases.
Thanks for info but here FAR made this buggy name instead of just opening empty existing file:) "Сам наломал дров - сам пусть и расхлебывает=))"

Anyway there is a way to create/rename/delete such buggy files. In NT systems special prefix "\\?" exists that should be placed before file/folder path for names longer than 260 characters. The joke is that if you pass such name, OS doesn't clear it from spaces etc so you may easilly create such non-deleteable file using simple command:

Code: Select all

echo Hello>"\\?\C:\123."
In this case dot will be really written into filename. And no app will work with such filename if it doesn't use prefix "\\?" or just removes extra dots at the end of name.

To delete such file you may use console command:

Code: Select all

del "\\?\C:\123."
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

MVV wrote:
DrShark wrote:You can read here (in russian) that FAR is a one of suggested tools for such cases.
Thanks for info but here FAR made this buggy name instead of just opening empty existing file:) "Сам наломал дров - сам пусть и расхлебывает=))"
About FAR bug I have to agree and Rynsrod have to contact to FAR Team regarding it.

My post is about a Total Commander-related problem: it cannot remove a buggy-named file while another file manager can.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It seems like FAR is using its hack (probably via \\?\ prefix) to create a name with trailing dot.

So why does TC pass "123." to the program and not "123"? It's for Notepad: If you pass "123" to notepad, it will create a file "123.txt" instead of opening "123".

Therefore I cannot change the current behaviour, sorry.
Author of Total Commander
https://www.ghisler.com
Post Reply