[Qt-interest] How to check between "Text" and "Non-Text" File

yogesh upreti yogesh.upreti at gmail.com
Tue Apr 20 09:54:21 CEST 2010


Hallo Group,
Can someone have any idea how to check between "Text" and "Non-Text" File?
I am making an application, which gives a preview of files depending on
type, i.e. if the file is a image, is shows a preview, if file is Text it
should show top 10 lines in a text edit.

I am able to recognise image file with extension, because normally in all
the system it is like that, but I am not able to recognise Text files (as
they can have any extension and some times no extension). I have to
differentiate them with Binary data files (because when I start reading them
my programme gets hang, or shows Garbage in text edit)

Can someone tell me how to recognise that?

Thanks
Yogesh Upreti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100420/f895fcc4/attachment.html 


More information about the Qt-interest-old mailing list