tclsqlite.c DB_COPY: binary mode?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

tclsqlite.c DB_COPY: binary mode?

Andy Goth
Is it really necessary for copy's input file to be fopen()ed with mode
"rb"?  This causes CRLF files opened on MS-Windows to have \r's appended
to the values in the last column.  The last column might otherwise be
numeric.

Actually, I'd prefer that DB_COPY accept a Tcl channel rather than a
filename.  (Of course, let's not break existing code.)  This way Tcl can
handle all the encoding and line ending junk, plus I can [seek] past
(okay, [gets] past) any header lines.  Moreover, this will make using
stdin possible (I read the header line, sqlite3's DB_COPY reads the
rest, and there's no seeking and no reopening).

--
Andy Goth
   <[hidden email]>
   <[hidden email]>

signature.asc (261 bytes) Download Attachment