Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
cbpporter is currently offline  cbpporter
Messages: 1401
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.

 
Read Message
Read Message
Previous Topic: FileSel vs. FileSelector documentation shortcoming
Next Topic: FileSel bug when displaying Han characters
Goto Forum:
  


Current Time: Fri May 03 04:21:38 CEST 2024

Total time taken to generate the page: 0.06464 seconds