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,405 of 243,242   
   James Kuyper to Michael S   
   Re: is_binary_file()   
   10 Dec 25 12:48:06   
   
   From: jameskuyper@alumni.caltech.edu   
      
   On 2025-12-10 04:21, Michael S wrote:   
   > On Tue, 9 Dec 2025 16:29:39 -0500   
   > James Kuyper  wrote:   
   ...   
   >> I just realized an annoying complication. Whatever   
   >> implementation-specific method is used to indicate end-of-line can   
   >> only be portably identified as such by opening the file in text mode   
   >> and looking for the newline characters that it gets converted into.   
   >> But because of 7.23.2p2, text mode cannot be relied upon for   
   >> precisely the files we're trying to identify.   
   >   
   > Does not sound like a problem. According to my understanding, wide   
   > portability was never a part of the OP's spec.   
      
   His spec was unclear. At least part of my intent in raising these issues   
   is to point out issues that he might not want to deal with, and which he   
   can justify ignoring by specifying that his routine is not intended to   
   deal with them.   
   Thinking about this particular problem, I see no way to deal with it in   
   general. Had I a need to write such a routine, I'd be happy to restrict   
   the validity of my code to platforms where end-of-line is is indicated   
   by a single new-line character. However, I suspect he might need Windows   
   compatibility, and might not need portability to Unix-like systems.   
      
   --- 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