From 7ea5c06059ee6668d6e6d04c3b3dcb8557061696 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 15 Jun 2012 13:27:59 +0000 Subject: Bu::Myriad now only uses BitString during initialization, and I'm going to replace that with just an array, no problem. It's many, many, many times faster while streams are growing, and it should be constant time, not linear like it was before. It also handles myriad files in excess of 2gb correctly now, at least, it seems to just fine :) --- src/stable/file.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/stable/file.cpp') diff --git a/src/stable/file.cpp b/src/stable/file.cpp index 33420f1..14e4f3c 100644 --- a/src/stable/file.cpp +++ b/src/stable/file.cpp @@ -91,7 +91,11 @@ Bu::size Bu::File::tell() if( fd < 0 ) throw FileException("File not open."); +#ifdef USE_64BIT_IO + return lseek64( fd, 0, SEEK_CUR ); +#else return lseek( fd, 0, SEEK_CUR ); +#endif } void Bu::File::seek( Bu::size offset ) @@ -99,7 +103,11 @@ void Bu::File::seek( Bu::size offset ) if( fd < 0 ) throw FileException("File not open."); +#ifdef USE_64BIT_IO + lseek64( fd, offset, SEEK_CUR ); +#else lseek( fd, offset, SEEK_CUR ); +#endif bEos = false; } @@ -108,7 +116,11 @@ void Bu::File::setPos( Bu::size pos ) if( fd < 0 ) throw FileException("File not open."); +#ifdef USE_64BIT_IO + lseek64( fd, pos, SEEK_SET ); +#else lseek( fd, pos, SEEK_SET ); +#endif bEos = false; } @@ -117,7 +129,7 @@ void Bu::File::setPosEnd( Bu::size pos ) if( fd < 0 ) throw FileException("File not open."); - lseek( fd, pos, SEEK_END ); + lseek64( fd, pos, SEEK_END ); bEos = false; } -- cgit v1.2.3