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

Jeroen De Wachter jeroen.dewachter at barco.com
Tue Apr 20 10:13:12 CEST 2010


Hey yogesh,

I don't know if you ever worked with the file command? Its sole purpose 
is to classify files.
Maybe you can get some ideas from the source code.

Best regards,

Jeroen

yogesh upreti wrote:
> 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
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>   



DISCLAIMER:
Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you.




More information about the Qt-interest-old mailing list