Re: [sqlite] Blob truncation

2008-04-24 Thread Dennis Cote
Vasil Boshnyakov wrote: It is not so effective to read the file twice - the first time to check the compressed size and the second pass - to do the actual streaming in the blob. That is what I am trying to avoid. Yes, I understand that, but SQLite is designed to store and retrieve blobs,

[sqlite] Blob truncation

2008-04-23 Thread vasil
Hello, I am trying to implement a simple file store based on the SQLite library. The idea is to use the SQLite as virtual folder. The logic is quite simple except the following detail: I need to read the files block by block (with 64k buffer size) and process each block with the zlib before

Re: [sqlite] Blob truncation

2008-04-23 Thread Robert Bielik
[EMAIL PROTECTED] skrev: Any help is very welcome and thank you in advice! The way I did it was to do a dummy write with a null device that just did: int write(const void * data, int dataLength) { blobLength += dataLength; } Then I used that length with sqlite3_bind_zeroblob and made

Re: [sqlite] Blob truncation

2008-04-23 Thread Dennis Cote
[EMAIL PROTECTED] wrote: Is there a way to truncate a blob (for example set it size to the file size before compression and after inserting the compressed data to truncate the unused blob space)? Or it is possible to change the blob size on the fly? Any help is very welcome and thank you in