[Solved] Problem with QDataStream on Mac
-
I am reading a binary data file using QDataStream on a Mac. QT4.7
I open a QFile (with file dialog) then create a QDataStream from it. Set version, floating point precision.
When I read the file, bytes with a hex value of 0D are skipped. This happens regardless of whether I use a readRawData method or whether I read individual values using >> operators?
So 0D is ASCII CR which is the line termination char on Mac OS... but this shouldn't be interpreted by QDataStream?
Am I missing something obvious?
-
Just compiled and ran the project on Windows 7 and had the same problem. I am doing a readRawData into a char buffer[] and comparing the in memory buffer contents to the results of
a hexdump of the file.Glenn
-
Can you post a test snippet, please.
-
Volker:
Thanks for the reply... but I just found the problem... it was in the underlying QFile, buried deep in a dialog box code, the underlying IODevice was getting set to TEXT mode.
Problem Solved... my bad.
Glenn
-
Oh... that old text mode for files ... always creating some fun :-)
You can mark the thread as solved by prepending [Solved] to the topic. Just click on the edit link below your username right of the original post.
-
Done, thanks.