You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Daniel Berger edited this page Dec 5, 2022
·
2 revisions
File.binary?(file)
Returns whether or not +file+ is a binary non-image file, i.e. executable, shared object, ect.
Note that this is NOT guaranteed to be 100% accurate. It performs a "best guess" based on a simple test of the first File.blksize characters, or 4096, whichever is smaller. It simply looks for a double null sequence internally.