DEV Community

Peter Shinners
Peter Shinners

Posted on

Windows dotted paths

I stumbled into learning that Windows (or NTFS?) does not allow filenames with trailing dots.

Internally it appearsthe dot is a separator between the base filename and the extension. Some tools treat the final dot as implied, so type plain. will show the contents of a file named plain.

Armed with this curiosity I decided to create a troublesome git repository to discover how Windows would treat such a thing?

  1. Indiscriminate error?
  2. Pick one arbitrary conflicting name?
  3. Privilege escalation?

https://github.com/PeterShinners/doomdots

PS C:\dev> git clone https://github.com/PeterShinners/doomdots.git
Cloning into 'doomdots'...
remote: Enumerating objects: 35, done.
remote: Counting objects: 100% (35/35), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 35 (delta 10), reused 0 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (35/35), 10.41 KiB | 1.16 MiB/s, done.
Resolving deltas: 100% (10/10), done.
error: invalid path 'MIXed.'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

PS C:\dev> cd .\doomdots\
PS C:\dev> git switch main
error: invalid path 'MIXed.'
error: invalid path 'enddot.'
error: invalid path 'extdot.txt.'
Enter fullscreen mode Exit fullscreen mode

It's likely these errors come from Git itself, and there's an alternative where it could fallback on some undefined system behavior.

Anyways, one more corner case to avoid along with mixed case naming conflicts and invalid characters.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay