home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 242,387 of 243,242   
   James Kuyper to bart   
   Re: is_binary_file()   
   09 Dec 25 16:23:07   
   
   From: jameskuyper@alumni.caltech.edu   
      
   On Mon, 8 Dec 2025 18:44:33 +0000, bart wrote:   
      
   > It's not clear what the actual problem is. What is the use-case for a   
   > function that tells you whether any file /might/ be a text-file based on   
   > speculative analysis of its contents?   
   >   
   > Is the result /meant/ to be fuzzy?   
   The fundamental problem is that no analysis of the contents can give you   
   anything other than a fuzzy result. There's nothing more clearly a   
   binary file than one that contains an array of binary floating point   
   numbers. However, just by chance, the binary numbers it contains could   
   happen to be such that every byte of that file can be interpreted as a   
   text character. How could an analysis of only the file tell you, with   
   certainty, that it wasn't a text file?   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca