Search code examples
eclipsefilebinaryeclipse-cdt

Why does Eclipse CDT generate a binary file when I make a .out extension file (instead of making a regular text file)


When programming in Eclipse CDT (neon), I have noticed that every time I make a file that is with the extension.out it automatically changes to a binary file. I'm not able to change that. Does anyone know how to fix this/why this is?

Image with the package explorer containing a regular txt file and a binary file:

enter image description here.


Solution

  • The reason is that traditionally .out has been the extension for executable files ("a.out" is file format and "a.out" is the default executable name for gcc if no -o is given.)

    If you do not use .out as your file extension of choice for binary files, right-click on the file, choose Open With -> Other, choose your preferred editor and check Use it for all '.out' files" if desired:

    editor selection

    You can also edit/update file types in Preferences -> General -> Editors -> File Associations:

    File Associations Preferences