Subject | Re: [firebird-support] Blob write to Embedded on Linux performance |
---|---|
Author | Frank Schlottmann-Gödde |
Post date | 2014-06-02T11:06:53Z |
Am 28.05.2014 11:38, schrieb Mike Ro miker169@... [firebird-support]:
are using a udf s.th. like:
void EXPORT fn_b_load ( char* s , BLOB b )
{
unsigned char *buffer;
if ( b->blob_handle )
{
int buffsize = 4096;
FILE *file;
unsigned char *fname = intern_recode(s);
file= fopen ( fname, "rb" );
if ( file )
{
buffer= ( unsigned char * ) malloc ( buffsize );
if ( buffer )
{
int readSize;
for ( ;; )
{
readSize = fread ( buffer,1,buffsize, file );
( *b->blob_put_segment ) ( b->blob_handle, buffer,readSize );
if ( readSize != buffsize )
break;
}
free ( buffer );
}
fclose ( file );
}
free( fname);
}
}
to load documents into the database.
I will try to find the time to check thiswith some big mp3's.
fsg
--
"Fascinating creatures, phoenixes, they can carry immensely heavy loads,
their tears have healing powers and they make highly faithful pets."
- J.K. Rowling
>Yes, of course, but I never felt the need to time the operations, we
>
> I am sorry to bump this, but has anyone else got experience of using
> blobs on Linux?
are using a udf s.th. like:
void EXPORT fn_b_load ( char* s , BLOB b )
{
unsigned char *buffer;
if ( b->blob_handle )
{
int buffsize = 4096;
FILE *file;
unsigned char *fname = intern_recode(s);
file= fopen ( fname, "rb" );
if ( file )
{
buffer= ( unsigned char * ) malloc ( buffsize );
if ( buffer )
{
int readSize;
for ( ;; )
{
readSize = fread ( buffer,1,buffsize, file );
( *b->blob_put_segment ) ( b->blob_handle, buffer,readSize );
if ( readSize != buffsize )
break;
}
free ( buffer );
}
fclose ( file );
}
free( fname);
}
}
to load documents into the database.
I will try to find the time to check thiswith some big mp3's.
fsg
--
"Fascinating creatures, phoenixes, they can carry immensely heavy loads,
their tears have healing powers and they make highly faithful pets."
- J.K. Rowling