Re: forcing html rendering for files without extensions
Steffen Nurpmeso <[email protected]>
| Newsgroups | gmane.comp.web.lynx.devel |
|---|---|
| Message-ID | <20260812222911.r1EPD7WB@steffen%sdaoden.eu> |
Mouse wrote in <[email protected]>: |> [...x-tar-gz...] |> So the idea was "recursively unpacking known extensions chains until |> no more unpacking is possible". | |Fine, but should it be driven off the name or the contents? I see |arguments both ways. Well. "Normally" the media type is simply derived from the extension. (Or not even that, some MUA do "is-text" content analysis and use text/plain if for good.) |>> [...], then the log.c file is probably C source in the first case |>> and probably not in the second, despite the identical names. | |>> The hard part, of course, is telling the difference mechanically; |>> that's why so many things use such heuristics. | |> [I]n practice, i find it constructed really, because i would assume |> the latter example being in a very dedicated environment that would |> not be mixed up. | |Probably. But it's happened to me at least once (finding a .c file |which was actually third in a series and confusing it with C source). Oh it happened to me, it did. That is to say .. to me it is either text or binary data .. which is what less(1) says when i go for a file. (Or actually it is alias v='LESS= less -RIFe') |> [B]ut on for example Windows people surely do not even *know* that |> this is possible, but take the file extension and program bundle for |> granted. | |Some of them. While they're rarer than among Unix types, I have met |Windows users who would know exactly what's going on there. | |I really blame the tools. Way too many Windows programs hide \.[^.]* |extensions, displaying only the part before that. I've long ago lost |count of the number of spams aimed at me which have things like an |attachment which the content says is something innocuous like a PDF, |but is named .rar and, based on the contents, would be more honestly |named with a .exe...presumably depending on the target's MUA to hide |the extension, or maybe depending on the target to not notice. I have not really used Windows since 95B. But i *think* to memorize that the file manager did show the name of the application that would open the file, rather than anything else. (I never used "icon views".) |> I would love to get this "extension-chain" notion into the wild. | |It already is, to at least some extent. I have seen, and use, .tar.bz2 |and the like routinely. A past version of my FTP server would |automatically handle them; for example, if there were a directory `src' |and you asked for src.tar.bz2, it would tar src up, bzip2 the result, |and send you that. (I arguably should readd that code to the FTP |server I now use, but so few people use it I'm not sure there's any |point.) Yes. But the question is in how far this is hardcoded and fixed to certain things, rather than following the "chain unpacking" thing. For example, here i can "tar -xf" a .tar.gz or what, but i think that on OpenBSD you will get a "roly poly hammer" (i could think it was him) asking you for correct command line arguments? And it is not "official" for IANA and media types, therefore lots of x-tar-gz and similar "fictional constructs" fly around, because people try to get the job done (tm). --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)