5 ms·
> People should learn some windows behaviors are not normal. Your computer shouldn't get slower over time, installing software from untrusted sources is not nor
by saagarjha 4y ago
> People should learn some windows behaviors are not normal. Your computer shouldn't get slower over time, installing software from untrusted sources is not normal, an extension is part of the name of a file and it should not be hidden, using the computer as administrator should be reserved for administrator tasks only, your desktop area is not /tmp/, drivers belong to the kernel and devices should work as soon as they are plugged in, the command line is not a thing of the past...
Playing devil’s advocate, the Unix/Linux model of things doesn’t have to be “normal” either. Why should file extensions be a thing? Why shouldn’t people use their desktop as they please? Why put drivers in the kernel?
- marcodiego 4y ago> Why should file extensions be a thing? Because they are part of the name of the file. Note: my file manager even identifies the mime type without extension. That is how it should be, changing the extension should not make the file harder to use. To this day, AFAIK, windows file manager still uses the extension to identify file type, thus allowing the user to easily change it may break expectation. GNOME's nautilus, KDE's Dolphin and even Apple's finder do it right: press f2 and you can rename the file without changing the extension, unless you go out of you way for that. It is also a security breach: image.jpg and image.exe may look the same. > Why shouldn’t people use their desktop as they please? Sure they should! But the fact that the OS lacks a working /tmp incentivizes a form of use that is disorganized and ugly. > Why put drivers in the kernel? Read about complaints about wacom tablet driver phoning home or printers drivers doing the same. To use my wacom tablet I simply plugged it. Since it is on the kernel, it will work on any architecture the kernel support. They didn't spent a dime to make it working on my raspi, for example. Also, once it is in the kernel, whoever change any internal api will fix every driver code to keep it working, so things that work once will work for a very long time. I met people who lost a TCE scanner and an ASUS mini projector because it wasn't supported by the most recent windows versions. The ASUS mini projector (disclaimer: I had a little involvement in the development of its driver) works on my rockpi4 just by plugging it; the windows experience with it is far from that simple.
- elxx 4y ago> GNOME's nautilus, KDE's Dolphin and even Apple's finder do it right: press f2 and you can rename the file without changing the extension, unless you go out of you way for that. This is exactly how Windows Explorer works by default too.
- archi42 4y agoIIRC that wasn't always the case. Maybe GP simply didn't use Windows since a long time. But you're right, and I wanted to drop the same hint. As much as I dislike the OS, I have to admit they made some improvements.
- marcodiego 4y agoSo this changed recently. Didn't know that.
- ziml77 4y agoThey introduced that feature a very long time ago too. I remember when they made the change because it made renaming files while having extensions visible was so much nicer. Hitting Ctrl-A to select everything in those cases where you do actually want to alter the extension is far easier than adjusting the selection to not include the extension for the common case where you don't want to change the extension.
- mike_hock 4y ago> Note: my file manager even identifies the mime type without extension. That is how it should be No, probing around the file content with a gazillion format-specific heuristics/hacks is not how it should be. This is a security problem because it makes the probing code a giant attack surface, and there have been CVEs related to precisely that. The file type should be determined from metadata only (simple, regular and without format-specific idiosyncrasies). Whether that metadata should be a suffix on the filename that's easy to mess up inadvertently is debatable, but Windows has the right idea here.
- marcodiego 4y ago
- GekkePrutser 4y agoFile extensions aren't really a thing in the UNIX world. Executables and scripts work just fine whatever extension they have, if any. The shell will call the 'file' command to figure out what it is. Some apps do care about extensions but this is not really an OS thing. And some files have to have specific names but that's really a thing in any OS.
- LtWorf 4y agoThe shell will NOT call the file command unless you type "file" and hit enter. Executables are executed by the kernel. They have the x bit set and a header that the kernel reads to decide what to do with them.
- IX-103 4y agoActually the header is read by the shell so it can call the appropriate loader. That may include running the file tool (or an internal equivalent that uses "database" of magic files).
- slabity 4y agoThat's completely incorrect. Where did you get that information from? A regular POSIX shell will simply call the `exec` syscall on the path provided. It may set up some environment variables or parse some arguments, but it will not actually read the file. In fact you can have a file with executable permissions, but not read permissions. The kernel determines how to execute the file based on its Magic Numbers, which are the first few bytes in certain file formats that will specify what type of file it is. It just so happens that the one for scripts are `#!`.
- GekkePrutser 4y agoI agree that I've simplified things a bit, 'file' is rather the user facing tool that does the same kind of inspection, and of course the X bit is a prerequisite. I know this but I didn't want to write a whole elaboration on my phone :) But my main point was that extensions aren't really a thing used at OS level to determine file type like on Windows, like the OP said.
- robertlagrant 4y ago> Why should file extensions be a thing? The problem is Windows does different things with files based on their extension, and hides their extension by default. Linux does neither.
- 323 4y agoWhat happens when you double click a .png file on Linux? It's exactly like Windows, it reads the extension and finds the associated app. I know you meant +x, but that is limited to only some files.
- robertlagrant 4y agoYes, you're right. Sloppy writing by me. Thanks for the cleanup!
- matheusmoreira 4y ago> Why should file extensions be a thing? They're not that important on Linux. Making files without extensions is simple and common. Honestly, file extensions are an annoying GUI thing. In the command line you pass the file as parameter to a program, the extension doesn't matter. Simply clicking on a file provides no information to the operating system about what program to invoke though, there needs to be additional metadata. So graphical environments created this notion of file associations based on extensions to the file name.