Unless I'm misusing it, I believe the shell readfile() function reads a file as text, not binary. I haven't checked writefile() for the same problem on writing.

This is how I use it, is this not correct?

create table t1(a blob);
insert into  t1 values(readfile('binfile'));
select * from t1;

I always see text and I expect to see one of the following cases:
1. a hex sequence regardless of file type
2. text (if the file was text), or a hex sequence if it was binary.

Instead, I see text when dealing with text files, and truncated text (up to the first zero) when dealing with binary.

Am I misusing it?

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to