> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Michael Robinson
> Sent: Friday, February 26, 2010 5:19 PM
> To: [email protected]
> Subject: [PLUG] C question...
>
> I'm trying to write a simple C program to open a text file
> with temperature data in it, extract the highest, the lowest,
> and the last temperature, and write that information to
> another text file.
>
> How in C do I verify that the files I'm working with are text files?
Make sure that all the characters in the file are printable text + CR and LF.
> Specifically since I don't allow clobbering, I'm worried
> about the input file.
Don't understand the question.
>
> I'm thinking there is a UNIX file command which I should be
> able to call from inside the C program, but is there a better way?
You are better off using a script.  Bash, perl, awk etc.

This sounds about the level of a first assignment in a C class. ;-)

- Bill Morita
wamorita At hevanet.com




_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to