Folders that names ended with a dot

Things you’d like to miss in the future...
highend
Posts: 13337
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Folders that names ended with a dot

Post by highend »

But it does... and it's happen a lot. I am a developer myself and have a lot specific tools which does that more often than usual apps unfortunately.
Again, nag their authors / yourself to create apps that don't behave like this. This is the ROOT of this issue. Fix the root!
Also as I mention before, Windows OS can handle this issues even without 7zip etc.
Let me quote myself:
Bug #1
Windows Explorer can't delete this folder as well
One of my scripts helped you out? Please donate via Paypal

Antieve
Posts: 72
Joined: 02 Apr 2016 20:52

Re: Folders that names ended with a dot

Post by Antieve »

Ok, 5 minutes research how cmd handle this:

Code: Select all

FindFirstFileW       x times to find all path dirs
RemoveDirectoryW     delete common way (one extra folder "bug" was created by me inside root "bug" folder so ignore that line)
FindFirstFileW       check and return path with needed name format
RemoveDirectoryW     remove bad-named dir by 8.3 name
RemoveDirectoryW     remove root dir
Full Call stack
Functions parameters

Because of another "bug" inside "bug" there is more calls than needed sry for that, to lazy to make new screenshots )

So I write program with 2 lines of code to check it:

Code: Select all

RemoveDirectoryW( "\\?\X:\bug\BUG~1" )
RemoveDirectoryW( "\\?\X:\bug" )
and it's done, directory was removed, easy right?

Useful links
You cannot delete a file or a folder on an NTFS file system volume

8.3 filename
Last edited by Antieve on 22 Apr 2018 23:11, edited 1 time in total.

highend
Posts: 13337
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Folders that names ended with a dot

Post by highend »

Unfortunately you haven't even read the docs: https://msdn.microsoft.com/en-us/librar ... s.85).aspx
SMB 3.0 does not support short names on shares with continuous availability capability.

Resilient File System (ReFS) doesn't support short names. If you call GetShortPathName on a path that doesn't have any short names on-disk, the call will succeed, but will return the long-name path instead. This outcome is also possible with NTFS volumes because there's no guarantee that a short name will exist for a given long name.
So your "example" of

Code: Select all

RemoveDirectoryW("\\?\X:\bug\<no, no 8.3 name available>")
will only work in very specific circumstances...
One of my scripts helped you out? Please donate via Paypal

Antieve
Posts: 72
Joined: 02 Apr 2016 20:52

Re: Folders that names ended with a dot

Post by Antieve »

will only work in very specific circumstances
which we talking about here )

I am not suggesting something from my head, it was Windows 7 call trace, suppose OS developers know what they do.
If you want some details just debug it step by step, I just take some common API calls in 5 min.
Maybe there is total solution in 7zip sources, haven't really looked yet

My point is - not so hard to implement to get it "out of the box" in XY, that's all.

highend
Posts: 13337
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Folders that names ended with a dot

Post by highend »

Args... :blackstorm: :bug: :cup:
One of my scripts helped you out? Please donate via Paypal

Post Reply