ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/04/30/01:21:56

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Date: Tue, 30 Apr 2002 08:15:05 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp AT delorie DOT com
Subject: Re: how to determine if a file is text/binary
In-Reply-To: <c21a43ff.0204291216.53eaf67c@posting.google.com>
Message-ID: <Pine.SUN.3.91.1020430081409.3296J-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 29 Apr 2002, xeon wrote:

> I'm wondering, how to determine is a file is a text file, or a binary
> file, programatically.

The usual technique is to read a portion of a file, say, 16KB, and see if 
it contains null characters (`\0').

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019