News for hackers. Stuff that matters.
Re:Dotfile Madness by codedokode on Monday October 24, 2022 @12:46AM (#33313019)
I think "hidden" files are a bad idea. What's the point of hiding some of the files in a directory from user? It only makes things more confusing.

For example the folder might look empty but in fact it could contain thousands of hidden files. You want to delete it as it is empty but accidentally delete important system files.

Even worse, imagine if all files on an USB drive are marked as hidden. You see that the drive is empty but when you attempt to copy something to it see a message that there is no free space.

One more example. Imagine if you have a project and want to edit an .env file. But as dotfiles are hidden in Linux you don't see this file and cannot open it. It turns out that Windows Explorer which doesn't hide dotfiles is much better for developing projects with Docker!

There should be no hidden files. We cannot do anything with Windows and their MS-DOS legacy but Linux could stop hiding dotfiles in GUI and CLI commands.

Re:Dotfile Madness by klodolph on Monday October 24, 2022 @01:34AM (#33313258)
Hidden files on MacOS were used sparingly—the main instance of a hidden file is the file which stores an icon for a folder, if the folder has a custom icon. Hidden files are only hidden from the UI, they appear normally in the command line.

The standard Unix folders (usr, var, etc) are also hidden—to be honest, this is a compromise because the Unix filesystem hierarchy sucks, but we are saddled with it for backwards compatibility reasons.

I did appreciate the relative clarity of old macOS systems—everything in the OS was in “System Folder”, the rest of the filesystem was yours, and you could freely move applications without breaking anything, uninstall them by putting them in the trash, etc.

Re:Dotfile Madness by codedokode on Monday October 24, 2022 @01:39AM (#33313277)
Hiding thumbnails cache is bad because a user might believe that the USB drive is empty and doesn't have any confidential data but the thumbnails cache might still have them.

There is no need to hide such files. Just display them as system files in Explorer.

> The standard Unix folders (usr, var, etc) are also hidden

Again there is no need to do it. Just move them to a directory named "System files".

Re:Dotfile Madness by klodolph on Monday October 24, 2022 @12:57PM (#33319224)
You can’t move “var” to a “System files” folder. This would break programs which expect /var to be, well, at /var. Long ago on macOS, everything was in “System Folder”, and it worked fine, but macOS has since inherited a massive Unix legacy.

Thumbnail caches are not stored on USB drives, they’re stored somewhere else, away from your files.

Re:Dotfile Madness by rollcat on Monday October 24, 2022 @08:27AM (#33315790)
For people out there on macOS, you can press Cmd-Shift-dot in Finder to toggle displaying any hidden files (including the standard UNIX hierarchy at /).

By the way, I'm pondering setting my XDG_*_HOME vars on Linux/BSD to use the macOS paths like ~/Library, just to see if the standard is actually being followed.

Re:Dotfile Madness by medstrom on Monday October 24, 2022 @03:12PM (#33321049)
I did a similar thing. I set XDG_CONFIG_DIR=~/ (normally ~/.config/). It works surprisingly well, though I encountered some edge cases that eventually made me give up. Also some programs don't know about XDG_CONFIG_DIR and just hardcode ~/.config/, but you can symlink ~/.config/ -> ~/.
Re:Dotfile Madness by 8n4vidtmkvmk on Monday October 24, 2022 @01:06AM (#33313128)
i just always list dotfiles for years now.. and my IDEs too. mostly a non issue.
Re:Dotfile Madness by codedokode on Monday October 24, 2022 @03:29AM (#33313867)
And I have to enable showing them on every system I work with (and add -a to every ls command, and google which option enables incldues them in pattern expansion). That is annoying.
Re:Dotfile Madness by 8n4vidtmkvmk on Monday October 24, 2022 @01:50PM (#33319948)
Well.. ya. I set up my aliases and then forget about it again. Globbing is mildly annoying but i think there's a dotglob option or something you can set
Re:Dotfile Madness by waste_monk on Monday October 24, 2022 @01:48AM (#33313313)
>What's the point of hiding some of the files in a directory from user? It only makes things more confusing.

If a user doesn't know what .ssh/ or .bash_history are, and it can hurt them to accidentally delete or modify them, why show them by default? It's like training wheels on a bike.

>For example the folder might look empty but in fact it could contain thousands of hidden files. You want to delete it as it is empty but accidentally delete important system files.

If it is possible for a regular user to accidentally brick a system like this, it was doomed to begin with. If a user doesn't know what a dotfile is they shouldn't have administrative privileges, and if they do get them there is no safeguard to stop them destroying the system. It's not a dotfile issue.

>Imagine if you have a project and want to edit an .env file. But as dotfiles are hidden in Linux you don't see this file and cannot open it. It turns out that Windows Explorer which doesn't hide dotfiles is much better for developing projects with Docker!

In what reality is someone developing software and building Docker containers who doesn't understand the concept of hidden files? Seems awfully contrived.

Re:Dotfile Madness by jl6 on Monday October 24, 2022 @02:35AM (#33313566)
> If a user doesn't know what .ssh/ or .bash_history are, and it can hurt them to accidentally delete or modify them, why show them by default? It's like training wheels on a bike.

This is really the problem with the home directory. It’s supposed to be the place where the user puts their files, but it’s also a place where applications put their files, usually without asking the user.

The battle is lost - the home directory territory should be ceded to applications and the user should have a separate space in which to manage their files.

This can sort of be achieved with the $XDG_CONFIG_HOME environment variable, but not all software respects it, so in practical terms it’s a lot easier just to leave $HOME to be the application config dumping ground.

Re:Dotfile Madness by delta_p_delta_x on Monday October 24, 2022 @05:13AM (#33314416)
It kind of goes around to the same point: developers are sloppy and assume that ~ or %USERPROFILE% has full read-write permissions, and treat the corresponding home directories as a free-for-all dumping ground.
Re:Dotfile Madness by medstrom on Monday October 24, 2022 @03:16PM (#33321109)
Yes! I did that long ago, putting my stuff in /home/kept/. I'm surprised at everyone who still puts their files in ~. What a mess.
Re:Dotfile Madness by codedokode on Monday October 24, 2022 @03:26AM (#33313858)
> If a user doesn't know what .ssh/ or .bash_history are, and it can hurt them to accidentally delete or modify them, why show them by default?

Because they are there. To prevent accidental deletion you can show an icon with a skull and crossbones or name a directory "configuration files" so that it is obvious what's in there.

> if they do get them there is no safeguard to stop them destroying the system

If the folder are named or labeled as "operating system" then the user will probably understand that it is better not to mess with it.

> In what reality is someone developing software and building Docker containers who doesn't understand the concept of hidden files?

Hiding hidden files is annoying because you have to add -a to ls command, have to add an option in Bash to include then when matching against a star pattern and to configure Explorer so that it shows them. It would be easier without them.

Re:Dotfile Madness by Iamreadingthehn on Monday October 24, 2022 @03:38AM (#33313915)
> To prevent accidental deletion you can show an icon with a skull and crossbones

This will make users more likely to delete it thinking it's a virus.

> If the folder are named or labeled as "operating system" then the user will probably understand that it is better not to mess with it.

Big assumption that most people know what an operating system is.

Re:Dotfile Madness by hrbf on Monday October 24, 2022 @04:11AM (#33314095)
> Hiding hidden files is annoying because you have to add -a to ls command

Have you ever heard of aliases?

Re:Dotfile Madness by codedokode on Monday October 24, 2022 @05:02AM (#33314363)
You are suggesting a workaround instead of solving the original problem.
Re:Dotfile Madness by hrbf on Monday October 24, 2022 @05:16AM (#33314429)
The workaround is trivial and painless, whereas “solving the original problem” would require fundamental changes to decades-old systems conventions. I was responding to the “annoying” part, which is effectively solved using an alias.
Re:Dotfile Madness by nephrite on Monday October 24, 2022 @03:42AM (#33313936)
> If a user doesn't know what .ssh/ or .bash_history are, and it can hurt them to accidentally delete or modify them, why show them by default? It's like training wheels on a bike.

You have permissions to prevent from accidental deletions.

Re:Dotfile Madness by delta_p_delta_x on Monday October 24, 2022 @05:24AM (#33314464)
Personally, I think hidden files are OK, but we have lousy defaults, regardless of OS.

By default, Explorer hides hidden files (and goes one step further and doesn't display file extensions: why???), so do Finder, Dolphin, Nautilus, and even `ls` by default.

Re:Dotfile Madness by Milner08 on Monday October 24, 2022 @07:00AM (#33315083)
Well yeah.. because they are hidden files. They wouldn't be hidden files if the default wasn't to hide them...
Re:Dotfile Madness by Already__Taken on Monday October 24, 2022 @07:09AM (#33315171)
hidden file extensions by default are to "save" users from renaming files and borking the extension. Later windows UX improved the renaming to help avoid selecting the extension.

file extensions are the mistake here really not them being hidden.

Re:Dotfile Madness by donatj on Monday October 24, 2022 @08:19AM (#33315735)
Executability based on extension combined with hidden extensions is imho one of Windows biggest mistakes. Make an exe, give it the icon of a word document - no way for a layperson to know it’s a trick.
Re:Dotfile Madness by maicro on Monday October 24, 2022 @10:22AM (#33316986)
"Show hidden files" and "show extensions for known file types" are two folder options I enable on any Windows system I touch / within a few minutes of installation. I'll take a bit of extra visual clutter if it means I can actually see what all is in a folder, vs. just assuming I know.
Re:Dotfile Madness by annowiki on Monday October 24, 2022 @08:14AM (#33315697)
When I run ls I don't want to see all the configuration files. Just my files. I think that's the point of hidden files.

> One more example. Imagine if you have a project and want to edit an .env file. But as dotfiles are hidden in Linux you don't see this file and cannot open it.

How likely is it that someone is going to want to edit a .env file and not know how to view hidden files?

Re:Dotfile Madness by jstanley on Monday October 24, 2022 @09:47AM (#33316553)
> When I run ls I don't want to see all the configuration files. Just my files.

Well then configuration files can simply not be in the same directory as your files. Easy fix.

Re:Dotfile Madness by SAI_Peregrinus on Tuesday October 25, 2022 @09:21AM (#33330113)
Your user doesn't have permissions to write to any directory that isn't yours. It doesn't mean configs have to be in your "documents" directory, but they do have to be in with your files!
Re:Dotfile Madness by jstanley on Tuesday October 25, 2022 @10:15AM (#33330724)
The comment I was responding to was talking about the utility of files being hidden.

But they don't need to be hidden by being special, they can just be "hidden" by living in a subdirectory that you don't look inside.

Re:Dotfile Madness by psd1 on Tuesday October 25, 2022 @04:39AM (#33327848)
Re accidental deletion, ntfs also has a "system" flag. Windows prompts if you delete one of those.