Note that there are some explanatory texts on larger screens.

plurals
  1. POreading from a text file: strange "\x01\0\0\0" sequences
    primarykey
    data
    text
    <p>I have been struggling with this issue for one week, and still far away from the solution.</p> <p>I am reading a plain text from a file by strings. It reads everything successfully until a character with a certain large number. This number is specific for each file, and is different for different files.</p> <p>After reaching the character with this large number, it reads "\x01\0\0\0" sequences (consist of 4 chars) for one or more times instead of the original characters, and then reads everything correctly (until the next large number).</p> <p>In a couple of words - instead of reading this:</p> <pre><code>... many characters ... First read failure! ... many characters ... Second read failure, second read failure! ... many characters ... etc. </code></pre> <p>it reads this:</p> <pre><code>... many characters ... First read f\x01\0\0\0re ... many characters ... Second read failu\x01\0\0\0\x01\0\0\0\x01\0\0\0ead failure! ... many characters ... etc. </code></pre> <p>Do you have any ideas about the cause of this problem?</p> <p>Additional information:</p> <pre><code> 1) The "ferror" condition is not true. 2) I am reading from file using streams (fopen, fread, fclose) 3) Have tested different read methods: "fread cycle" and "fgets". The results are the same. 4) The binary optimization is disabled in the compiler's settings. It seams that the problem is not connected with a compiler. Neither GCC, nor Apple LLVM gives me the desired result. 5) Attempting to solve the issue, I converted the whole project from C++ to C, but the problem doesn't disappear. </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload