Before I remove text/x-sh and the like so that shell and tcl scripts
files are served as 'application' like others, I would like to hear if
some of you see a potential problem with that.
Judging from IANA's registered types for other script languages, it
looks like the application type is more relevant. Also, the
application/ types appear first in our /etc/media.types file, and if I remember well this gives them precedence anyway. A quick random check
in the Internet shows that there is no consistency on how shell scripts
are served, but that the application type is used among others.
Before I remove text/x-sh and the like so that shell and tcl scripts
files are served as 'application' like others, I would like to hear if
some of you see a potential problem with that.
Since Bullseye, the /etc/mime.types is provided in its own package, media-types, and in Bookworm I would like to brush up its contents
further.
For scripting languages like sh and Python, I'm not sure: either way
could be appropriate. Which is more common: sharing scripts as source
code to read and edit, or sharing scripts as executables to download
and run as-is? If the former, text/ makes sense, if the latter,
application/.
If scripts and other source code are to be served as application/*, it
would be good to check that all our "programmer's editor"-style programs
have a MIME association set up for that type. In an extremely quick survey
of the .desktop files of editors I happen to have installed on my GNOME laptop: gedit (a text editor) only registers itself to handle text/plain, GNOME Builder (an IDE for programmers) handles both text/ and application/ for a wide variety of languages, and gvim (a text editor in hard mode :-) mostly only handles text/ types, except for application/x-shellscript
where it only has application/ and not text/ for whatever reason.
What is the relationship between /etc/mime.types
and /usr/share/mime/globs, please? When to use the one and when,
the other?
Using types outside text/ is definitely appropriate for very verbose text languages like SVG and "flat" OpenDocument, where it's *technically*
text, and *technically* you could edit it with a text editor, but in
practice that's rarely what anyone wants.
For scripting languages like sh and Python, I'm not sure: either way
could be appropriate. Which is more common: sharing scripts as source
code to read and edit, or sharing scripts as executables to download
and run as-is? If the former, text/ makes sense, if the latter,
application/.
On Sun, Aug 29, 2021 at 2:13 PM Simon McVittie wrote:
For scripting languages like sh and Python, I'm not sure: either way
could be appropriate. Which is more common: sharing scripts as source
code to read and edit, or sharing scripts as executables to download
and run as-is? If the former, text/ makes sense, if the latter, application/.
I would lean towards encouraging review of scripts rather than
downloading and executing them.
Simon McVittie dijo [Sun, Aug 29, 2021 at 03:13:02PM +0100]:
Using types outside text/ is definitely appropriate for very verbose
text languages like SVG and "flat" OpenDocument, where it's
*technically* text, and *technically* you could edit it with a text
editor, but in practice that's rarely what anyone wants.
For scripting languages like sh and Python, I'm not sure: either way
could be appropriate. Which is more common: sharing scripts as source
code to read and edit, or sharing scripts as executables to download
and run as-is? If the former, text/ makes sense, if the latter,
application/.
I side with Paul Wise -- If a script is served by a Web server to a
browser, I don't think the desired result will be to download and
execute right away.
Simon McVittie dijo [Sun, Aug 29, 2021 at 03:13:02PM +0100]:
Using types outside text/ is definitely appropriate for very verbose text languages like SVG and "flat" OpenDocument, where it's *technically*
text, and *technically* you could edit it with a text editor, but in practice that's rarely what anyone wants.
For scripting languages like sh and Python, I'm not sure: either way
could be appropriate. Which is more common: sharing scripts as source
code to read and edit, or sharing scripts as executables to download
and run as-is? If the former, text/ makes sense, if the latter, application/.
I side with Paul Wise -- If a script is served by a Web server to a
browser, I don't think the desired result will be to download and
execute right away. text/* seems much better suited for me. Users
willing to execute said scripts should download and execute locally --
and nobody should be bitten by the surprise of automatic (even after a
UI acknowledgement) code execution of random Internet content.
It is usually easy to save a text file from a web browser, while
it is hard (impossible?) to persuade it to display an unknown
application/* type. Thus, even if your latter example is more
common, it may be preferable use text/.
The major difference is fallback behaviour. If a client (web browser or[snip]
email client or similar) receives a file with a text/* type for which it
has no special handler, in the absence of other context it is expected
to treat it like text/plain, and show the file to the user as text. If a client receives a file with an unknown application/* type, it is expected
to treat it like application/octet-stream, assume that viewing the file as text would be pointless because the user wouldn't necessarily understand
it anyway, and offer to save it or open it in an external program instead.
For scripting languages like sh and Python, I'm not sure: either way
could be appropriate. Which is more common: sharing scripts as source
code to read and edit, or sharing scripts as executables to download
and run as-is? If the former, text/ makes sense, if the latter,
application/.
It is usually easy to save a text file from a web browser, while it is hard (impossible?) to persuade it to display an unknown application/* type. Thus, even if your latter example is more common, it may be preferable use text/.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (0 / 16) |
| Uptime: | 165:51:19 |
| Calls: | 12,096 |
| Calls today: | 4 |
| Files: | 15,001 |
| Messages: | 6,517,807 |