Translate
-
Hi, I'm having some problems reading a file containing null-terminations. When I try reading the file into a string, it stops at the first binary null ('\0'). On unix we have an excellent command, the tr command. It would solve the problem: To delete all NULL characters from a file, enter: tr -d '\0' < textfile > newfile Is there a way of either translating the NULL's, removing them or even skipping them? If anyone have suggestions, please respond.
-
Hi, I'm having some problems reading a file containing null-terminations. When I try reading the file into a string, it stops at the first binary null ('\0'). On unix we have an excellent command, the tr command. It would solve the problem: To delete all NULL characters from a file, enter: tr -d '\0' < textfile > newfile Is there a way of either translating the NULL's, removing them or even skipping them? If anyone have suggestions, please respond.
-
Hi, I'm having some problems reading a file containing null-terminations. When I try reading the file into a string, it stops at the first binary null ('\0'). On unix we have an excellent command, the tr command. It would solve the problem: To delete all NULL characters from a file, enter: tr -d '\0' < textfile > newfile Is there a way of either translating the NULL's, removing them or even skipping them? If anyone have suggestions, please respond.
If you just need the whole files content, without any line-breaks etc, reading it in binary mode is the way to go. Then you can copy it into a std::vector < char > , and use std:: algorithms on it. -- "My opinions may have changed, but not the fact that I am right." Found in the sig of Herbert Kaminski