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)
Getting the file type. (binary vs text files) [message #14196] Tue, 19 February 2008 16:17 Go to next message
captainc is currently offline  captainc
Messages: 278
Registered: December 2006
Location: New Jersey, USA
Experienced Member
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?
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.

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


Current Time: Tue Mar 19 08:51:08 CET 2024

Total time taken to generate the page: 0.02031 seconds