Users browsing this thread: 5 Guest(s)
seninha
Long time nixers
Indeed, the UNIX way file naming is extension-less short names, relying on magic numbers, file content, shebangs, file permissions and the path (files in /usr/man/* are probably man pages) to guess the file type. But when those meta-information are not available, like when moving files between systems or downloading them, file extensions come in handy.

I keep my documents and plain text files extensionless. And when I need to move files around, most of the times I do this visually and interactively rather than statically via shell globing (I use a script I made that opens vim with all files listed, each one in a line, and then I do renaming or moving via the editor). But probably I will give this idea up when I need to write some script. Adding a .txt file doesn't hurt and is way better than using file(1) or find(1) to select files by type.

(12-11-2020, 04:36 PM)zge Wrote: The problem is that the Unix filesystem doesn't embed file-types (or miscellaneous file attributes), creating the need for stuff like magic bytes or file extentions. I'd imagine it would be better if you could extend a glob with something like "*:type=exec" or "summer_1025*:type=image/*".
Haiku solves this problem by adding metadata to their database-based filesystem, file types are just a "column" for the file in the database. I don't know how this can be used on the command line, like globing. A database/metadata-based filesystem would be nice and solve problems like those as well.


Messages In This Thread
File extensions - by stratex - 12-11-2020, 02:57 PM
RE: File extensions - by venam - 12-11-2020, 03:43 PM
RE: File extensions - by jkl - 12-11-2020, 03:48 PM
RE: File extensions - by opfez - 12-11-2020, 03:58 PM
RE: File extensions - by jkl - 12-11-2020, 04:09 PM
RE: File extensions - by venam - 12-11-2020, 04:24 PM
RE: File extensions - by pkal - 12-11-2020, 04:36 PM
RE: File extensions - by seninha - 12-11-2020, 04:36 PM
RE: File extensions - by stratex - 12-11-2020, 04:56 PM
RE: File extensions - by jkl - 12-11-2020, 05:04 PM
RE: File extensions - by Dworin - 12-11-2020, 11:52 PM
RE: File extensions - by movq - 13-11-2020, 05:02 PM
RE: File extensions - by mattrose - 13-11-2020, 09:03 PM
RE: File extensions - by Dworin - 14-11-2020, 12:01 AM
RE: File extensions - by mattrose - 14-11-2020, 01:07 AM
RE: File extensions - by z3bra - 14-11-2020, 06:08 AM
RE: File extensions - by venam - 14-11-2020, 06:28 AM
RE: File extensions - by s0kx - 14-11-2020, 06:35 AM