I don't see a need, extensions are there for helping software more than helping people.
It's actually the opposite. To my knowlegde, Windows is the only OS that I've used that uses the file extension to determine the contents, but then they hide it from the user. So maybe file extensions are only for windows?
How does osx know how to open a PDF not named .PDF?
The standard system in macOS is based on a Uniform Type Indicator, or UTI, like public.plain-text for a plain text file, and public.jpeg for a JPEG image.
To determine the file type, macOS uses MIME types when downloading from the Internet, can still use old Classic Mac OS four-character type codes, and ultimately relies on UTIs.
To get the UTI of a given file, use the mdls (meta data list, part of Spotlight) command in the Terminal.
Check out https://en.m.wikipedia.org/wiki/Uniform_Type_Identifier for more info.
PDFs have a MIME type of application/pdf
per the spec, but you might still encounter some with MIME types like application/x-pdf
. MacOS reads the MIME type of a file, then assigns the com.adobe.pdf
UTI (if it wasn’t already assigned by another Mac application).
Huh, TIL. Thanks!
i dknt understand
The Freedesktop Foundation has already categorized a ton of stuff and more.
could you link the index apologies
Here's the repo: https://gitlab.freedesktop.org/xdg/shared-mime-info
Here's the current XML for the metadata: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/blob/b7db17480af0aeeb6df5668e8d10e275527d2825/data/freedesktop.org.xml.in
mate i am so confused sorry
Here's an example of a PNG:
This says that PNG files...
- Have a mime type of image/png
- Have a full name of "PNG image"
- Have an acronym of "PNG"
- Have an expanded acronym of "Portable Network Graphics"
- From byte 0, all PNG files have "\x89PNG\r\n\x1A\n" in the file content
- Match a file glob pattern of "*.png" (case insensitive)
There are hundreds of entries like this in the XML with formal categorization :)
It sounds like you're trying to approach a solved problem, though. Why are you building a file list, and what are you going to use it for? What are you ultimately trying to do?
im trying to find the 'best' format for each category
Asklemmy
A loosely moderated place to ask open-ended questions
If your post meets the following criteria, it's welcome here!
- Open-ended question
- Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
- Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
- Not ad nauseam inducing: please make sure it is a question that would be new to most members
- An actual topic of discussion
Looking for support?
Looking for a community?
- Lemmyverse: community search
- sub.rehab: maps old subreddits to fediverse options, marks official as such
- !lemmy411@lemmy.ca: a community for finding communities
~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~