[Q] Why is .BIN an obsessively used file extension?

Discussion in '3DS - Homebrew Development and Emulators' started by WhoAmI?, May 21, 2015.

  1. WhoAmI?
    OP

    WhoAmI? PASTA's dirty animal

    Member
    1,273
    1,009
    Mar 15, 2015
    Poké Ball
    Okay, just wondering - why is .BIN used a lot, for file extensions? Aren't file extensions typically used to distinguish different types of files from each other?

    For example, when we backup our NAND - why is .BIN used when logically it should be .IMG? We quite literally create an image of the NAND, so why not use .IMG?

    At the moment, the 3DS scene has an odd file naming scheme. For example, on Windows - you have .exe's, .dll's etc etc.

    If I was to name a .java programme as .exe - would it work? Nope. How would I be able to distinguish a Java file from a Windows executable, if the file extension is the same?

    It's like when we use win32diskimager to backup/restore our nands - wouldn't it be more convenient for us to use .img as a file extension so we don't have to keep manually enter "NAND.BIN" into explorer, just so it'll show up in the "browse dialogue"?

    I'm not complaining or anything, I just think that we and devs should be using different file extensions instead of obsessively using .bin, as not every .bin file does the same thing...

    Example:

    We call our NAND backups "NAND.BIN" and we call WebHax LoadCode payloads "code.bin", yet you can't launch "NAND.BIN" through the web exploit, can you? I'm just saying that if a file has a different purpose - give it a different file extension. You know, be original....

    So yeah... You think we should make a standard for 3DS-related files? I think we should - everything seems to be a bit of a mess at the moment, with all the .BINs here and there...
     
    Margen67 likes this.
  2. Jhyrachy

    Jhyrachy GBAtemp Regular

    Member
    215
    71
    Jul 25, 2011
    Italy
    because bin stands for "binary"
     
    Margen67 likes this.
  3. WhoAmI?
    OP

    WhoAmI? PASTA's dirty animal

    Member
    1,273
    1,009
    Mar 15, 2015
    Poké Ball

    Yeah... Pretty much everything digital is considered a binary... Is your whole music collection called .bin, too? Why can't things follow more of a standard like the PC? When you RIP a CD - You can store it as .iso or .img. When you image a Raspberry Pi SD card - the extension used is .img... Things are tidier and more identifiable that way...

    Just because everything is stored in binary, doesn't mean we should name everything as .BIN. We have file extensions for a reason...
     
  4. gamesquest1

    gamesquest1 Nabnut

    Member
    GBAtemp Patron
    gamesquest1 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    14,150
    9,502
    Sep 23, 2013
    because its the default "not really a specific file", filename....you can rename your nand to NAND.NAND if you like, but for files with little purpose other than storing data that isnt intended to get opened a lot by a program it saves having 9999999999999999999999999999999999 different file types,

    basically, if its not a common file format, it is generally left as .bin or whatever, if its a actual file format that you need to be able to recognize i.e you know .jpg is a picture, .mp3 is music etc, it would be much more confusing if everything needed a specific extension, the extensions are really only there so the OS knows that program to open it with, so filename = for you to know what it is, extension = for the system to know what format it is and how to open it
     
    m0rt, Tomato Hentai and mid-kid like this.
  5. WhoAmI?
    OP

    WhoAmI? PASTA's dirty animal

    Member
    1,273
    1,009
    Mar 15, 2015
    Poké Ball

    Perhaps... .IMG is already an existing file type though... We open NAND files with win32diskimager, right? Why not make things easier for ourselves and give it a standard naming scheme? It's like with DS games. We could've saved the roms as .bin but we used .nds, instead as it made things more identifiable...

    We have .3dsx files... Why not name them to .bin, like most other payloads on the 3DS? Just saying... We seem to name executable's as .BIN's as well as archives/images...

    Edit: I'm personally gonna start using .IMG, for NAND backups.. Just my preference.
     
  6. Steveice10

    Steveice10 GBAtemp Maniac

    Member
    1,102
    1,657
    Jul 19, 2009
    United States
    Because NDS files follow a specific file format. 3DSX files follow a specific file format. NAND dumps are just raw binary dumps of a NAND sectors that don't follow a specific file format.
     
    klear likes this.
  7. gamesquest1

    gamesquest1 Nabnut

    Member
    GBAtemp Patron
    gamesquest1 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    14,150
    9,502
    Sep 23, 2013
    suppose nand dumps do technically fit the .IMG criteria, they are just an image of the nand....thats why win32diskimager looks for .img files as thats its main usage, so either one is correct, .bin as its not actually a file with a format, or .img, as despite it not technically being a file format, it is a .img file i.e a image of a disk
     
    WhoAmI? likes this.
  8. WhoAmI?
    OP

    WhoAmI? PASTA's dirty animal

    Member
    1,273
    1,009
    Mar 15, 2015
    Poké Ball

    Whats the different between a raw image file and a raw dump of NAND sectors? Commonly, in "the world of unix" - when someone images a drive with "dd", they usually use .img, e.g. "dd if=/dev/sda1 of=/media/sdc/backup.img". dd copies everything byte for byte, just like a raw backup.

    If most users use Windows to make nand dumps, why aren't we using file types that programs typically support by default. E.g. The disk imager software on windows, typically looks for .img, right? Why don't we use .img?
     
    Margen67 likes this.
  9. gamesquest1

    gamesquest1 Nabnut

    Member
    GBAtemp Patron
    gamesquest1 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    14,150
    9,502
    Sep 23, 2013
    we can....but as the files are pretty much hardly ever needed (unless your doing extensive nand flashing) you gain practically nothing by calling them .img, plus GW dumps them as .bin, and restores them as .bin....so its generally just accepted that you keep your nand.bin safe, we don't want to confuse people by some people saying nand.bin, and others saying nand.img......yeah same file, but lets be a bit unified on that front, if you want to name them .img thats upto you, but i doubt there will be any major movement with everyone changing their file name just for the sake of it
     
    WhoAmI? likes this.
  10. Steveice10

    Steveice10 GBAtemp Maniac

    Member
    1,102
    1,657
    Jul 19, 2009
    United States
    Don't NAND dumps usually come out still encrypted, though? If it's encrypted, it isn't usable as a .img file.
     
  11. Kafke

    Kafke GBAtemp Fan

    Member
    415
    144
    Jan 2, 2009
    United States
    File extensions are strictly a "windows" convention. There's no real point to them, and any well constructed format should be able to be identified by the content (usually using a marker of some sort at the beginning of the file). The extensions are for user convenience, and windows (and mac too, to an extent) has started to rely on them for file identification.

    ".BIN" is the extension for a generic binary file. Likewise ".DAT" is the extension for a generic data file. They are widely used for the same reason ".TXT" is widely used. Ideally each unique filetype should have it's own extension, but that's hardly ever the case.


    Both are binary data They are just used in different ways.
     
  12. gamesquest1

    gamesquest1 Nabnut

    Member
    GBAtemp Patron
    gamesquest1 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    14,150
    9,502
    Sep 23, 2013
    yeah generally .img is a raw filesystem, but really .img would just cover any raw sector dump from a disk, even if it was encrypted
     
    Margen67 and WhoAmI? like this.
  13. WhoAmI?
    OP

    WhoAmI? PASTA's dirty animal

    Member
    1,273
    1,009
    Mar 15, 2015
    Poké Ball

    As gamesquest1 said - it's still a raw copy, it doesn't matter if it's encrypted. RAW copies of a disk still counts as an image. That's like me imaging an encrypted hard drive and saying that it's not an image because I can't use it...
     
    Margen67 likes this.
  14. Steveice10

    Steveice10 GBAtemp Maniac

    Member
    1,102
    1,657
    Jul 19, 2009
    United States
    I suppose, although the argument that .img is better because programs look for it is false, as raw NAND dumps wouldn't work in said programs.
     
  15. WhoAmI?
    OP

    WhoAmI? PASTA's dirty animal

    Member
    1,273
    1,009
    Mar 15, 2015
    Poké Ball

    So NAND.BIN doesn't work in win32diskimager? That's a surprise... I was saying that using .img would be better instead of .bin because it'll make things more identifiable in the long run. It'll save us more time, over a period... Just think about all those seconds wasted, typing "NAND.BIN" when you could be clicking on it instead.


    If we keep naming things ".bin", why even bother specifying .bin? The extension means nothing if it isn't used for anything...
     
  16. gamesquest1

    gamesquest1 Nabnut

    Member
    GBAtemp Patron
    gamesquest1 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    14,150
    9,502
    Sep 23, 2013
    win32diskimager looks for .img, and then lets your write it directly to a disk....in this case the 3DS nand.

    same way as .3ds can be opened with 3dsmax, or different .3ds files would open in 3dsexplorer, the extension is only as good as the program trying to open it, in both those cases the program is correct to be looking for .3DS, but even different file format can share the same extension
     
    WhoAmI? likes this.
  17. Steveice10

    Steveice10 GBAtemp Maniac

    Member
    1,102
    1,657
    Jul 19, 2009
    United States
    I'll concede the point about NAND. BIN is just what was first used I guess. Although, things for mounting an IMG for file access wouldn't work with it encrypted, and changing it doesn't really have too much use.
    It does mean something. It means that the contents are generic binary data with no specified format. For example, LoadCode payloads are bin files because they are raw binary data for code, not in a specific format like elf, 3dsx, etc.
     
    Margen67 and WhoAmI? like this.
  18. Kafke

    Kafke GBAtemp Fan

    Member
    415
    144
    Jan 2, 2009
    United States

    Pretty much. The extension is only useful for local filesystems. To distinguish a .bin from a .dat, for example. One current project I'm working on uses .BIN to distinguish archive files, while it uses other 'new' extensions (like SBF) for other filetypes. As I said, it's mostly convention. You don't even *need* an extension. Instead of having 'filename.bin', you could just have 'filename'
     
    billzo and WhoAmI? like this.
  19. WhoAmI?
    OP

    WhoAmI? PASTA's dirty animal

    Member
    1,273
    1,009
    Mar 15, 2015
    Poké Ball

    I understand that - my main point was pretty much NAND.BIN files, to be honest.
     
  20. Jim_e

    Jim_e Advanced Member

    Newcomer
    79
    41
    Nov 13, 2007
    United States
    There's nothing to get so worked up about. File extensions are just left overs from old file systems. We could get rid of all file extensions now, more useful information is stored in metadata anyway. In fact many operating systems try to hide that file extensions even exist anymore(which is a security issue).

    File extensions aren't as useful as they were. 3 character namespace is simply insufficient to denote all possible file formats. Now they are just evolutionary leftovers. Naming things dot bin is just a way to denote that no specific program will guarantee know what to do with the file.
     
    mid-kid and cearp like this.