By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
Probably the easiest way is to use the C Run Time function, isprint. That will determine if a byte is a printable character. As you scoot through the file, as soon as you find a byte that's not printable, you can probably safely assume it's not a text file. Of course, if you want to allow UNICODE text files, you'll have to do much more work, which is not fool proof.
Dig Deeper on Windows Operating System Management
Related Q&A from John Robbins
What is a JAD session? This term is referred to often in job postings and seems like some kind of brainstorm you carry out with a client to define IT...continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.