aboutsummaryrefslogtreecommitdiff
path: root/src/tests/bigmyriad.cpp
blob: 9d24741841aacf8afaeea6aed75767389e5eb479 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <bu/myriad.h>
#include <bu/myriadstream.h>
#include <bu/file.h>

int main()
{
    Bu::File f("big.myr", Bu::File::Read|Bu::File::Write|Bu::File::Create );
    Bu::Myriad m( f, 256, 12 );

    char *buf = new char[1024*1024*10];

    for( int j = 0; j < 25; j++ )
    {
        memset( buf, j, 1024*1024*10 );
        m.create( Bu::Myriad::Write ).write( buf, 1024*1024*10 );
//        m.sync();
        printf("\r%03d%%", (j+1)*100/25 );
        fflush( stdout );
    }

    printf("\n\n");

    return 0;
}