home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume2
/
linksrc
/
binary.c
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1991-08-07
|
277 b
|
30 lines
/*
* See if a file is Ascii or not.
*
* Keyword: binary file status
*/
#include <stdio.h>
main()
{
int ii, jj, kk;
kk = 0;
for (ii=0; ii < 100; ii++)
{
if ( (jj = getchar()) == EOF )
{
break;
}
if (jj == 0 || jj > '~')
{
kk = 1;
break;
}
}
printf("%d\n",kk);
}