.jpg.jpeg




  • Winner of the 2016 Presidential Election

    We've got to protect users from themselves, right?



  •  Just don't use extensions - then you won't have that problem. Any good operating system should be able to guess.



  •  Wow.



  • @Daniel15 said:

    Is that message specific to whatever software that is? (Is that Opera?) Or is it an OS-wide thing? (What is that? OSX?)

    What does it even mean that a file can only be saved with one particular extension?

    ... And how does allowing two extensions make this any better?

    Why are my brains leaking out of my ears?



  • @cheapie said:

    Just don't use extensions - then you won't have that problem. Any good operating system should be able to guess.

    File extensions are useful for people, not just MS DOS.

    For example, if you see a file named pony.jpg, you know it's probably a picture of a pony. pony.mp4 is probably a video of a pony. pony.tex is the source code for your dissertation on ponies.

    With file extensions, all of those files can be named pony without conflicting with each other.

    Need a more real-world example? .c and .h - generally the declarations and definitions are stored in files with the same name except for extension.



  • The real question is: what happened during the last 11 days. Huge bender?



  • @Ben L. said:


    For example, if you see a file named pony.jpg, you know it's probably a picture of a pony.

    Except when it's not. Not to mention extension spoofing, .jpg.exe, and all that stuff



  • @Maciejasjmj said:

    @Ben L. said:
    @cheapie said:
    Just don't use extensions - then you won't have that problem. Any good operating system should be able to guess.

    File extensions are useful for people, not just MS DOS.

    For example, if you see a file named pony.jpg, you know it's probably a picture of a pony. pony.mp4 is probably a video of a pony. pony.tex is the source code for your dissertation on ponies.

    With file extensions, all of those files can be named pony without conflicting with each other.

    Need a more real-world example? .c and .h - generally the declarations and definitions are stored in files with the same name except for extension.

    Except when it's not. Not to mention extension spoofing, .jpg.exe, and all that stuff

    The article you linked to links to this other article which I think you should read.

    Long story short: "jpeg images can contain viruses" is only true if you already have a virus that modifies your image viewer. By the same token, someone could make a virus that modified MS Word to delete every file on your hard drive when you opened a document. Does that mean Word documents delete every file on your hard drive?

    As for jpeg.exe, hopefully your OS doesn't set the execute bit on newly downloaded files.



  • @Ben L. said:

    As for jpeg.exe, hopefully your OS doesn't set the execute bit on newly downloaded files.

    How do you "set the execute bit" on Windows? By clicking yes on the UAC warning?

    Of course who cares, Windows has a mere 90.6% of the market share*, let's make snide comments using references that are relevant only in the remaining 9.4%.

    * Windows 8 alone has a bigger marketshare than OSX.



  • @Ben L. said:

    By the same token, someone could make a virus that modified MS Word to delete every file on your hard drive when you opened a document

    Why bother? All it takes is one dumb user who clicks "Yes" to everything, including warnings about macros. But hey, it's a .doc, so it must be safe, amirite?

    Also, yes, you can embed a virus in a .jpg image, all it takes is a vulnerability in your image displaying library. Like (now fixed) this one

    A buffer overrun vulnerability exists in the processing of JPEG image formats that could allow remote code execution on an affected system. Any program that processes JPEG images on the affected systems could be vulnerable to this attack, and any system that uses the affected programs or components could be vulnerable to this attack. An attacker who successfully exploited this vulnerability could take complete control of an affected system.

    @Ben L. said:

    As for jpeg.exe, hopefully your OS doesn't set the execute bit on newly downloaded files.

    What execute bit? Are extensions not good enough for you?



  • @Maciejasjmj said:

    @Ben L. said:
    @Maciejasjmj said:
    @Ben L. said:
    @cheapie said:
    Just don't use extensions - then you won't have that problem. Any good operating system should be able to guess.

    File extensions are useful for people, not just MS DOS.

    For example, if you see a file named pony.jpg, you know it's probably a picture of a pony. pony.mp4 is probably a video of a pony. pony.tex is the source code for your dissertation on ponies.

    With file extensions, all of those files can be named pony without conflicting with each other.

    Need a more real-world example? .c and .h - generally the declarations and definitions are stored in files with the same name except for extension.

    Except when it's not. Not to mention extension spoofing, .jpg.exe, and all that stuff

    The article you linked to links to this other article which I think you should read.

    Long story short: "jpeg images can contain viruses" is only true if you already have a virus that modifies your image viewer. By the same token, someone could make a virus that modified MS Word to delete every file on your hard drive when you opened a document. Does that mean Word documents delete every file on your hard drive?

    As for jpeg.exe, hopefully your OS doesn't set the execute bit on newly downloaded files.

    Why bother? All it takes is one dumb user who clicks "Yes" to everything, including warnings about macros. But hey, it's a .doc, so it must be safe, amirite?

    Also, yes, you can embed a virus in a .jpg image, all it takes is a vulnerability in your image displaying library. Like (now fixed) this one

    A buffer overrun vulnerability exists in the processing of JPEG image formats that could allow remote code execution on an affected system. Any program that processes JPEG images on the affected systems could be vulnerable to this attack, and any system that uses the affected programs or components could be vulnerable to this attack. An attacker who successfully exploited this vulnerability could take complete control of an affected system.

    What execute bit? Are extensions not good enough for you?

    Okay. Let's make this real simple. I've enlarged the text that you've (so far) adamantly refused to quote. Thank you for missing the entire point of this conversation.

    Also, that security vulenerability you linked to was a vulnerability in WINDOWS. Not the jpeg file format. Not a popular jpeg viewer. WINDOWS THE OPERATING SYSTEM. In fact, every reference to a virus or vulnerability so far in this thread has been Windows-specific. Maybe it's time to reconsider which OS we use. Oh wait, we can't, because Windows has different APIs than EVERY OTHER FUCKING OPERATING SYSTEM ON THE PLANET so we'd have to port all our software.



    Sorry for the rant.



  • @Ben L. said:

    Maybe it's time to reconsider which OS we use. Oh wait, we can't, because Windows has different APIs than EVERY OTHER FUCKING OPERATING SYSTEM ON THE PLANET so we'd have to port all our software.
    Every OS has its own APIs, so that comment really makes no sense. Other than that, I agree with your original point about extensions. As for some of the other comments:

    .jpg files are data files. The image viewer reads the data and displays it. You can embed viruses in .jpgs all you want but nothing will happen unless (a) your computer is already infected with a virus which then looks for the additional virus data stored in the .jpg  or (b) you have a time machine and can back to <font size="4">2004</font> when there was a buffer overflow bug in Microsoft's .jpg library.

    The only reason that a file named <font face="courier new,courier">something.jpg.exe</font> is a potential problem is because of Microsoft's incredibly stupid decision to hide extensions by default. A stupid decision that they still refuse to fix. Once again this is not a problem with .jpg files, it's a problem with stupid developers setting stupid defaults.



  • @El_Heffe said:

    @Ben L. said:
    Maybe it's time to reconsider which OS we use. Oh wait, we can't, because Windows has different APIs than EVERY OTHER FUCKING OPERATING SYSTEM ON THE PLANET so we'd have to port all our software.
    Every OS has its own APIs, so that comment really makes no sense.

    Wouldn't it be nice if there was some standard for different operating systems to have the same APIs?



  • @Arnavion said:

    Is that message specific to whatever software that is? (Is that Opera?) Or is it an OS-wide thing? (What is that? OSX?)
    I'd still like an answer to this. What piece of crapware is this?

     



  • @cheapie said:

     Just don't use extensions - then you won't have that problem. Any good operating system should be able to guess.

    I rather not have my OS guess. With file extensions and a literate user, the OS opens the program that I expect it to open, rather than the program that the content dictates. For example, if someone renames "evilsoftware.exe" to "kittens.jpg", I would rather have an image viewer barf on it than have my OS say "Hey, this is a program, I'm going to execute it". As for stupid users opening "kittens.jpg.exe"; I don't care - at least the problem can be fixed over time and only affects users that make a mistake.



  • @Jaime said:

    @cheapie said:

     Just don't use extensions - then you won't have that problem. Any good operating system should be able to guess.

    I rather not have my OS guess. With file extensions and a literate user, the OS opens the program that I expect it to open, rather than the program that the content dictates. For example, if someone renames "evilsoftware.exe" to "kittens.jpg", I would rather have an image viewer barf on it than have my OS say "Hey, this is a program, I'm going to execute it". As for stupid users opening "kittens.jpg.exe"; I don't care - at least the problem can be fixed over time and only affects users that make a mistake.

    EXECUTE BIT, PEOPLE. USE IT ONLY ON PROGRAMS YOU WANT TO BE ABLE TO RUN.



  • @HardwareGeek said:

    @Arnavion said:

    Is that message specific to whatever software that is? (Is that Opera?) Or is it an OS-wide thing? (What is that? OSX?)
    I'd still like an answer to this. What piece of crapware is this?

     


    Google to the rescue!



  • @Ben L. said:

    Google to the rescue!
    Thank you.


     



  • @Arnavion said:

    (Is that Opera?)

    Office.



  • @Jaime said:

    @cheapie said:

     Just don't use extensions - then you won't have that problem. Any good operating system should be able to guess.

    I rather not have my OS guess. With file extensions and a literate user, the OS opens the program that I expect it to open, rather than the program that the content dictates. For example, if someone renames "evilsoftware.exe" to "kittens.jpg", I would rather have an image viewer barf on it than have my OS say "Hey, this is a program, I'm going to execute it". As for stupid users opening "kittens.jpg.exe"; I don't care - at least the problem can be fixed over time and only affects users that make a mistake.

    Or we could move past file names actually indicating the file content. Extensions are a relic from an OS not wanting to store metadata or read the first 3 bytes of file to determine its type. Ever notice how websites don't have index.html files showing anymore and instead have pretty urls, yet somehow the browser still knows what files its receiving? That's how your file system SHOULD be, but naturally the NeckBeards 2.0 (mostly us 30 somethings who watched DOS vanish) insist on the archaic extension naming convention because they can't fathom how it could work otherwise.

    To put it another way more people might understand, it's hungarian notation. Imagine you set the type of your variables by name in C#. eg: playersInt = 5, greetingString = "hello", peopleList = ...well you get the point.



  • Is that message specific to whatever software that is? (Is that Opera?) Or is it an OS-wide thing? (What is that? OSX?)

    Microsoft Outlook on OS X. Apparently the built-in Mail app in OSX doesn't behave well with the Exchange setup at work so we need to use Outlook. It really hasn't been too bad though, I expected a lot worse from a Microsoft app on an Apple OS.


  • Winner of the 2016 Presidential Election

    @Ben L. said:

    @Maciejasjmj said:
    @Ben L. said:
    @Maciejasjmj said:
    @Ben L. said:
    @cheapie said:
    Just don't use extensions - then you won't have that problem. Any good operating system should be able to guess.

    File extensions are useful for people, not just MS DOS.

    For example, if you see a file named pony.jpg, you know it's probably a picture of a pony. pony.mp4 is probably a video of a pony. pony.tex is the source code for your dissertation on ponies.

    With file extensions, all of those files can be named pony without conflicting with each other.

    Need a more real-world example? .c and .h - generally the declarations and definitions are stored in files with the same name except for extension.

    Except when it's not. Not to mention extension spoofing, .jpg.exe, and all that stuff

    The article you linked to links to this other article which I think you should read.

    Long story short: "jpeg images can contain viruses" is only true if you already have a virus that modifies your image viewer. By the same token, someone could make a virus that modified MS Word to delete every file on your hard drive when you opened a document. Does that mean Word documents delete every file on your hard drive?

    As for jpeg.exe, hopefully your OS doesn't set the execute bit on newly downloaded files.

    Why bother? All it takes is one dumb user who clicks "Yes" to everything, including warnings about macros. But hey, it's a .doc, so it must be safe, amirite?

    Also, yes, you can embed a virus in a .jpg image, all it takes is a vulnerability in your image displaying library. Like (now fixed) this one

    A buffer overrun vulnerability exists in the processing of JPEG image formats that could allow remote code execution on an affected system. Any program that processes JPEG images on the affected systems could be vulnerable to this attack, and any system that uses the affected programs or components could be vulnerable to this attack. An attacker who successfully exploited this vulnerability could take complete control of an affected system.

    What execute bit? Are extensions not good enough for you?

    Okay. Let's make this real simple. I've enlarged the text that you've (so far) adamantly refused to quote. Thank you for missing the entire point of this conversation.

    Also, that security vulenerability you linked to was a vulnerability in WINDOWS. Not the jpeg file format. Not a popular jpeg viewer. WINDOWS THE OPERATING SYSTEM. In fact, every reference to a virus or vulnerability so far in this thread has been Windows-specific. Maybe it's time to reconsider which OS we use. Oh wait, we can't, because Windows has different APIs than EVERY OTHER FUCKING OPERATING SYSTEM ON THE PLANET so we'd have to port all our software.



    Sorry for the rant.

    Am I the only one who remembers that the first gen iPhone jailbreak was a malformed image file that exploited a buffer overrun to install Cydia?

    I wanted to go to the Apple Store and jailbreak all the display models; but I didn't feel like having them press charges against me.



  • @Daniel15 said:

    Is that message specific to whatever software that is? (Is that Opera?) Or is it an OS-wide thing? (What is that? OSX?)

    Microsoft Outlook on OS X.

    So... is there a reason Outlook wants to not let you save a JPEG with the .jpg extension?



  • @Ben L. said:

    .c and .h - generally the declarations and definitions are stored in files with the same name except for extension.
    Bad example, because it's wrong. In academia it may hold true, but not in general.


  • Discourse touched me in a no-no place

    @cheapie said:

    Just don't use extensions - then you won't have that problem. Any good operating system should be able to guess.
    Doesn't work for all file types. In particular, I've yet to see an OS that manages to guess the type of a CSV file without a hint in the way of an extension. (This is a PITA. There are various hacks to work around it… but even so.)



  • @Arnavion said:

    @Daniel15 said:
    Is that message specific to whatever software that is? (Is that Opera?) Or is it an OS-wide thing? (What is that? OSX?)

    Microsoft Outlook on OS X.

    So... is there a reason Outlook wants to not let you save a JPEG with the .jpg extension?

     Probably a messed-up type registration: Outlook indicates to the system that it may create JPEG files with a .jpeg extension (but no .jpg extension), and then attempts to save a JPEG file with a default name of “something.jpg”.

    I guess the OS could try to detect that the application provided an incorrect file extension and fix it, but it could cause issues with some corner cases (names containing dots but without an extension, for instance)

    @dkf said:

    @cheapie said:
    Just don't use extensions - then
    you won't have that problem. Any good operating system should be able
    to guess.
    Doesn't work for all file types. In particular, I've
    yet to see an OS that manages to guess the type of a CSV file without a
    hint in the way of an extension. (This is a PITA. There are various
    hacks to work around it… but even so.)
     

    Same thing for OpenDocument files which are really zip files, and .cbr files which are rar files...



  • @dkf said:

    ]Doesn't work for all file types. In particular, I've yet to see an OS that manages to guess the type of a CSV file without a hint in the way of an extension. (This is a PITA. There are various hacks to work around it… but even so.)

    File formats without magic number headers are always going to be a headache. this excel bug feature got a client a few weeks ago.



  • @Ben L. said:

    File extensions are useful for people, not just MS DOS.
     

    If, so, why do the newer versions of MS DOS hidem them from the user?


  • SockDev

    @Zemm said:

    this excel bug feature
     

    Got to love the step-by-step instructions on how to add an apostrophe to the first line :S



  • @cheapie said:

    Just don't use extensions - then you won't have that problem. Any good operating system should be able to guess.

    Did you, by any chance, had anything to do with designing Petrovich?



  • @Soviut said:

    Or we could move past file names actually indicating the file content. Extensions are a relic from an OS not wanting to store metadata or read the first 3 bytes of file to determine its type. Ever notice how websites don't have index.html files showing anymore and instead have pretty urls, yet somehow the browser still knows what files its receiving? That's how your file system SHOULD be, but naturally the NeckBeards 2.0 (mostly us 30 somethings who watched DOS vanish) insist on the archaic extension naming convention because they can't fathom how it could work otherwise.

    To put it another way more people might understand, it's hungarian notation. Imagine you set the type of your variables by name in C#. eg: playersInt = 5, greetingString = "hello", peopleList = ...well you get the point.

    Which is not uncommon or superfluous in dynamic typed programming languages. Because they don't inherently store the type metadata (at least at compile time).
    One would be hard pressed to say that all methods of transferring files support this. A lot of filesystems (not just FAT, but also e.g. UDF) don't store the file type (cmiiw).
    And even through MIME is common in e-mail and web if only I'd have a quarter for everytime I have seen the wrong MIME type or application/octet-stream...



  • People are arguing that linux is better because

    1. It uses a long list of magic bytes instead of extensions to identify files
    2. It uses a special bit in the metadata to identify executables
    3. It's POSIX compliant
    all three of which are very bad ideas in my opinion


  • Except like nobody (especially linux devs) bother complying to it. Pottering and co have already said they don't care about anything other than Linux.



  • @Soviut said:

    @Jaime said:
    @cheapie said:

     Just don't use extensions - then you won't have that problem. Any good operating system should be able to guess.

    I rather not have my OS guess. With file extensions and a literate user, the OS opens the program that I expect it to open, rather than the program that the content dictates. For example, if someone renames "evilsoftware.exe" to "kittens.jpg", I would rather have an image viewer barf on it than have my OS say "Hey, this is a program, I'm going to execute it". As for stupid users opening "kittens.jpg.exe"; I don't care - at least the problem can be fixed over time and only affects users that make a mistake.

    Or we could move past file names actually indicating the file content. Extensions are a relic from an OS not wanting to store metadata or read the first 3 bytes of file to determine its type. Ever notice how websites don't have index.html files showing anymore and instead have pretty urls, yet somehow the browser still knows what files its receiving? That's how your file system SHOULD be, but naturally the NeckBeards 2.0 (mostly us 30 somethings who watched DOS vanish) insist on the archaic extension naming convention because they can't fathom how it could work otherwise.

    To put it another way more people might understand, it's hungarian notation. Imagine you set the type of your variables by name in C#. eg: playersInt = 5, greetingString = "hello", peopleList = ...well you get the point.

    The web isn't exactly a model to be followed.  For example, if I link a style sheet to an html page and in the tag, I explicitly say type="text/css", Chrome will refuse to process it if the MIME type is wrong. I know what it is, I told the browser what it is and how I wanted it used, but Chrome looked and said "This seems to be a plain text file, screw you".  Having the content describe itself is great in Utopia, but we live in a world where every file you access is potentially trying to infect your system.

    BTW, the only reason we don't have index.html any more is so that we can keep a consistent URL even if the underlying technology changes. That has much more to do with how search engines work and the desire to not break external links as it does describing content.



  • @anonymous234 said:

    People are arguing that linux is better because

    1. It uses a long list of magic bytes instead of extensions to identify files
    2. It uses a special bit in the metadata to identify executables
    3. It's POSIX compliant
    all three of which are very bad ideas in my opinion
    Can you explain 2 and 3? I kinda see where you might be misinformed to think 1 is a bad thing, but what's wrong with unix permissions or POSIX compliance?


  • I am no expert on this but ... there are differing levels of compliance, Windows with Cygwin for example is "mostly compliant". Linux and FreeBSD aren't compliant because of the financial costs of being certified, even though they maybe compliant (but we don't know).

     



  • @Soviut said:

    That's how your file system SHOULD be, but naturally the NeckBeards 2.0 (mostly us 30 somethings who watched DOS vanish) insist on the archaic extension naming convention because they can't fathom how it could work otherwise.
    No, we understand exactly how things would work in an alternate reality without the "archaic extension naming convention" and think that it's a really bad idea. @Soviut said:
    Extensions are a relic from an OS not wanting to store metadata or read the first 3 bytes of file to determine its type.
    No, people want a sane system where files are clearly labled in a way that is immediately obvious and doesn't involve messing about with metadata and magic bytes. What you are advocating is essentially the same stupid system that Microsoft has already created. Windows hides file extensions by default because Microsoft believes you don't need to know what type of file it is. Just click on it and the computer will take care of the rest. Trust me. What could possibly go wrong.



  • @Ben L. said:

    @anonymous234 said:
    People are arguing that linux is better because

    1. It uses a long list of magic bytes instead of extensions to identify files
    2. It uses a special bit in the metadata to identify executables
    3. It's POSIX compliant
    all three of which are very bad ideas in my opinion
    Can you explain 2 and 3? I kinda see where you might be misinformed to think 1 is a bad thing, but what's wrong with unix permissions or POSIX compliance?

    (2) atleast is a simple but outdated model that persists only because the various Unices and its descendants are slow to change. The ACL model is superior. Linux has SELinux and that other one whose name escapes me, but it does not seem to have have much traction in public.



  • @VinDuv said:

    @Arnavion said:

    @Daniel15 said:
    Is that message specific to whatever software that is? (Is that Opera?) Or is it an OS-wide thing? (What is that? OSX?)

    Microsoft Outlook on OS X.

    So... is there a reason Outlook wants to not let you save a JPEG with the .jpg extension?

     Probably a messed-up type registration: Outlook indicates to the system that it may create JPEG files with a .jpeg extension (but no .jpg extension), and then attempts to save a JPEG file with a default name of “something.jpg”.

    Why on Earth does an application on OSX have to register filetypes that it can create. On every other OS an applications registers the filetypes it can open. How does a text editor on OSX work? Does it register the filetype "*" ? Does that still allow you to write extensionless files?



  • @Soviut said:

    Ever notice how websites don't have index.html files showing anymore and instead have pretty urls, yet somehow the browser still knows what files its receiving? That's how your file system SHOULD be, but naturally the NeckBeards 2.0 (mostly us 30 somethings who watched DOS vanish) insist on the archaic extension naming convention because they can't fathom how it could work otherwise.
     

    Bad example, because the server tells the browser the data's mime-type as part of the http/https network protocol.  And the web server determines that from... dun dun dun... the file's extension and a lookup table.  As for not needing the index.html, that's part of the web server configuration... Apache, nginx, IIS, etc... all have a list of documents to look for when a browser requests just a directory name... and this can be set on a per-directory basis.

    If the web server tells you that a binary file is of mime-type text/plain (which is Apache's default for unknown file types), your browser displays it as pages of garbage instead of attempting to download the file.

     



  • @El_Heffe said:

    @Soviut said:
    Extensions are a relic from an OS not wanting to store metadata or read the first 3 bytes of file to determine its type.
    No, people want a sane system where files are clearly labled in a way that is immediately obvious and doesn't involve messing about with metadata and magic bytes.

    To add on to that, magic bytes in the file break being able to pipe text files between existing programs. If every log file had a particular 3 bytes at the front every CLI text-processing tool (grep, etc.) would have to be programmed to ignore the first three bytes, cat would have to be changed to not output the first three bytes, etc. Essentially the same problems that we have with the UTF-8 BOM right now.

    If everyone in the world used the One True Filesystem (tm) then we could make a case for putting the mimetype or 3 bytes or whatever into the inode metadata and rest assured everyone would be able to see it regardless of their OS or physical medium. We're partway there already now that extensions are no longer treated specially by filesystems (not since the 8.3 days) but a unified metadata format that can survive Windows, Unix, CDs and thumb drives will probably not happen anytime soon.


  • Winner of the 2016 Presidential Election

    @powerlord said:

    And the web server determines that from... dun dun dun... the file's extension and a lookup table, or a database query, or an RPC call, or metadata associated with the file, or by inspecting the file contents...

    FTFY.



  • @powerlord said:

    Bad example, because the server tells the browser the data's mime-type as part of the http/https network protocol.  And the web server determines that from... dun dun dun... the file's extension and a lookup table.  As for not needing the index.html, that's part of the web server configuration... Apache, nginx, IIS, etc... all have a list of documents to look for when a browser requests just a directory name... and this can be set on a per-directory basis.

    If the web server tells you that a binary file is of mime-type text/plain (which is Apache's default for unknown file types), your browser displays it as pages of garbage instead of attempting to download the file.

    There is 1 caveat for that though. IE tends to ignore that shit if you are using a generic handler in .NET (.ashx) and it is a known file type, even if you set the mime type as text/plain or application/json from the handler .... and yes this is shit.

     



  • @Arnavion said:

    @El_Heffe said:
    @Soviut said:
    Extensions are a relic from an OS not wanting to store metadata or read the first 3 bytes of file to determine its type.
    No, people want a sane system where files are clearly labled in a way that is immediately obvious and doesn't involve messing about with metadata and magic bytes.

    To add on to that, magic bytes in the file break being able to pipe text files between existing programs. If every log file had a particular 3 bytes at the front every CLI text-processing tool (grep, etc.) would have to be programmed to ignore the first three bytes, cat would have to be changed to not output the first three bytes, etc. Essentially the same problems that we have with the UTF-8 BOM right now.

    If everyone in the world used the One True Filesystem (tm) then we could make a case for putting the mimetype or 3 bytes or whatever into the inode metadata and rest assured everyone would be able to see it regardless of their OS or physical medium. We're partway there already now that extensions are no longer treated specially by filesystems (not since the 8.3 days) but a unified metadata format that can survive Windows, Unix, CDs and thumb drives will probably not happen anytime soon.

    Explain to me how exactly plain text files need a distinct "type" known to the OS. As far as I'm concerned, the difference between .txt, .log, .java, .sql, etc. is for humans only, not anything a computer needs to know to read files.



  • @Ben L. said:

    @Arnavion said:
    @El_Heffe said:
    @Soviut said:
    Extensions are a relic from an OS not wanting to store metadata or read the first 3 bytes of file to determine its type.
    No, people want a sane system where files are clearly labled in a way that is immediately obvious and doesn't involve messing about with metadata and magic bytes.

    To add on to that, magic bytes in the file break being able to pipe text files between existing programs. If every log file had a particular 3 bytes at the front every CLI text-processing tool (grep, etc.) would have to be programmed to ignore the first three bytes, cat would have to be changed to not output the first three bytes, etc. Essentially the same problems that we have with the UTF-8 BOM right now.

    If everyone in the world used the One True Filesystem (tm) then we could make a case for putting the mimetype or 3 bytes or whatever into the inode metadata and rest assured everyone would be able to see it regardless of their OS or physical medium. We're partway there already now that extensions are no longer treated specially by filesystems (not since the 8.3 days) but a unified metadata format that can survive Windows, Unix, CDs and thumb drives will probably not happen anytime soon.

    Explain to me how exactly plain text files need a distinct "type" known to the OS. As far as I'm concerned, the difference between .txt, .log, .java, .sql, etc. is for humans only, not anything a computer needs to know to read files.

    Are you seriously saying that a computer doesn't need to know the difference between a .java and .sql file? I feel a blakeyrant coming on...



  • @mikeTheLiar said:

    @Ben L. said:
    @Arnavion said:
    @El_Heffe said:
    @Soviut said:
    Extensions are a relic from an OS not wanting to store metadata or read the first 3 bytes of file to determine its type.
    No, people want a sane system where files are clearly labled in a way that is immediately obvious and doesn't involve messing about with metadata and magic bytes.

    To add on to that, magic bytes in the file break being able to pipe text files between existing programs. If every log file had a particular 3 bytes at the front every CLI text-processing tool (grep, etc.) would have to be programmed to ignore the first three bytes, cat would have to be changed to not output the first three bytes, etc. Essentially the same problems that we have with the UTF-8 BOM right now.

    If everyone in the world used the One True Filesystem (tm) then we could make a case for putting the mimetype or 3 bytes or whatever into the inode metadata and rest assured everyone would be able to see it regardless of their OS or physical medium. We're partway there already now that extensions are no longer treated specially by filesystems (not since the 8.3 days) but a unified metadata format that can survive Windows, Unix, CDs and thumb drives will probably not happen anytime soon.

    Explain to me how exactly plain text files need a distinct "type" known to the OS. As far as I'm concerned, the difference between .txt, .log, .java, .sql, etc. is for humans only, not anything a computer needs to know to read files.

    faceimage

    Are you seriously saying that a computer doesn't need to know the difference between a .java and .sql file? I feel a blakeyrant coming on...

    Well, other than maybe opening them in different editors it really shouldn't care as you probably just want to edit the text contained within.  Until you tell another program to do something with the text found inside anyway.



  • @locallunatic said:

    Well, other than maybe opening them in different editors it really shouldn't care as you probably just want to edit the text contained within.

    I think that's more important than you think. "Open with" is annoying enough as it is.
    @locallunatic said:
    Until you tell another program to do something with the text found inside anyway.

    An important distinction, that I missed. I fear I must humbly lower my level of outrage. Also, there's something else important that I missed:
    @Ben L. said:
    Explain to me how exactly plain text files need a distinct "type" known to the OS.

    I am truly sorry that I didn't read every word of every previous post. I merely assumed that Ben L. was saying something mind-shatteringly stupid*, as is his wont, and leapt to indignant fury. In reality, it was just garden-variety stupid.

    *that computers don't need to know about file types



  • @Ben L. said:

    Explain to me how exactly plain text files need a distinct "type" known to the OS. As far as I'm concerned, the difference between .txt, .log, .java, .sql, etc. is for humans only, not anything a computer needs to know to read files.

    Because the shell/DE or whatever you are using tend to lend associations based on the file type on what programs will open it. Also things like a webserver tend to like to assign a handler of some sort when a particular file type is requested (which was previously mentioned).

    Also it is also human readable ... "oh this is a jpeg ... therefore it is probably a picture". "oh it is an XLS it is probably an excel file". This has .cs as the file extension ...so it if probably a C# source file.

    I am sure there are other reasons but those are good enough for me.

     



  • Of course it doesn't. Rename xyz.java to xyz.sql, tell your java whatever to read xyz.sql, and it'll go ahead with no complaints (I confess, I don't know what those extensions are for(I know what java and sql are, just not the particular extensions)). Programs don't care about extensions, they care about the contents of a file. I can tell a c compiler to compile a file of any extension, and so long as the contents can be compiled it won't give an error. I can even tell it to output to a file with an extension that is not .o!

    Some programs may limit what sort of files they open, but that's just an interface detail. To keep the human from selecting the wrong file. Once the program has requested the file to the OS, the name no longer matters.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.