Date: Thu, 10 Aug 1995 12:28:45 +0300 (IDT) From: Eli Zaretskii To: "Dr. Norman Fahrer" Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: 'file' util for dos On Wed, 9 Aug 1995, Dr. Norman Fahrer wrote: > I use the DOS ported awk and want to make sure > that the file it works on is NOT a binary but > a TEXT file, so not to run into the 'out of memory' > problem that occures when the record which is read > in is the entire file. > > What would be a good way to prevent that the awk > is fed with a NOT-text file (under DOS) ? Your best bet is to write a small program which reads the first, say 4KB of the file, then for non-text characters in that block. If it finds them, let it return a non-zero status to DOS, which you can test for either in a batch file or from inside Awk.