Community
Participate
Working Groups
Created attachment 140344 [details] Patch which fixes the bug Build ID: 20090619-0625 Steps To Reproduce: 1. Create a binary which name has other suffix than "exe". For example: invisible_binary.bin unrecognized.bin.i386 2. CDT will not show it as a binary in the Projects view. More information: CDT includes code which omits binaries which have other suffix than "exe". On Linux there's no way how to recognize that file is a binary only from its name. I attach the patch which removes the described code. I tested it and it works pretty well. Binaries are now recognized by the magic numbers, which is portable.
The reason we don't do this by default is performance. If you don't pre-filter files by extension then you end up opening every file looking for magic bytes which is hugely expensive. Note that we do examine files which don't have any extension. Perhaps you should just add the extensions you listed to the set of built-in .exe type content types?
(In reply to comment #1) > looking for magic bytes which is hugely expensive. > Yes, it is. On the Linux platform I would suggest to filter the files based on their executable permissions. File permissions are stored in inodes and these are cached by the kernel. Such a filtering should be really fast. > Note that we do examine files which don't have any extension. Perhaps you > should just add the extensions you listed to the set of built-in .exe type > content types? > Thank you! This is a very good workaround. I added my extensions in Preferences/General/Content Types/Binary File.