It is currently April 23rd, 2024, 4:33 pm

A little logical help

Get help with creating, editing & fixing problems with skins
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

A little logical help

Post by death.crafter »

So, while testing FileView plugin, I saw a thing...

A gitignore file's extension was listed as gitignore.

If you are not familiar with it, it is a file used by git, and is named as .gitigonre without any extensions. And I believe, it's a file without extension.

But since it has a dot at the beginning FileView lists gitignore as it's extension. So, should I escape cases like these? Or just leave it as is?
from the Realm of Death
User avatar
Brian
Developer
Posts: 2681
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: A little logical help

Post by Brian »

I believe any character(s) after the last . is considered the file extension, or at least Windows "sees" it that way. You can test this by running dir /oe in your cmd prompt. That will sort a directory by extension.

In my view, the entire file is called .gitignore, the file name is empty, and the extension is gitignore.....but obviously this is all open to interpretation.


To answer your question, I think it would depend on how you displaying things. If you are displaying the name and extension of the file separately, then it might make sense to escape "dot" files like this and display them as the name of the file instead of the extension. But it might be more trouble than it's worth.

-Brian
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: A little logical help

Post by death.crafter »

Brian wrote: December 30th, 2021, 8:10 am I believe any character(s) after the last . is considered the file extension, or at least Windows "sees" it that way. You can test this by running dir /oe in your cmd prompt. That will sort a directory by extension.

In my view, the entire file is called .gitignore, the file name is empty, and the extension is gitignore.....but obviously this is all open to interpretation.


To answer your question, I think it would depend on how you displaying things. If you are displaying the name and extension of the file separately, then it might make sense to escape "dot" files like this and display them as the name of the file instead of the extension. But it might be more trouble than it's worth.

-Brian
It's not actually, it's only a single condition, but why I assume it is a file is that you can't have two gitigonre files in a directory.

So, I'll pr the change, you can choose to leave it out.

Hope your holidays are going well! 🎄
from the Realm of Death
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: A little logical help

Post by death.crafter »

Okay, it might be a little twisted, but it'd be worth it, when HideExtensions is used, I would escape dot files. Because empty strings won't make much sense. But the extensions would still stay as is.
from the Realm of Death