aboutsummaryrefslogtreecommitdiff
path: root/src/tests/bigmyriad.cpp
blob: 73a33153c602cc13ee1b438625c467854baf183a (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
26
#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, 512, 12 );

#define SSIZE (1024*8) // 1024*1024*10
    char *buf = new char[SSIZE];

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

    printf("\n\n");

    return 0;
}