Home » U++ Library support » FileSel&FileList, Path » Getting the file type. (binary vs text files)
|
Re: Getting the file type. (binary vs text files) [message #14197 is a reply to message #14196] |
Tue, 19 February 2008 18:54  |
cbpporter
Messages: 1427 Registered: September 2007
|
Ultimate Contributor |
|
|
captainc wrote on Tue, 19 February 2008 17:17 | I would like to test for file type. Mainly I want to check whether a file is binary or text. What is the best way to do this?
|
Actually, the difference between a text file and a binary file is not really present in it's hardware or filesystem representation (at least not under the OSs I know), just in the way we write read from it. It is just a formal difference. Still, if you want only ASCII text, you can read the file and check if all the characters are alphanumeric plus punctuation signs.
|
|
|
Goto Forum:
Current Time: Fri Apr 25 11:55:53 CEST 2025
Total time taken to generate the page: 0.00931 seconds
|