summaryrefslogtreecommitdiff
path: root/src/file.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-05-13 13:43:57 +0000
committerMike Buland <eichlan@xagasoft.com>2010-05-13 13:43:57 +0000
commit2a943828287d2a861930d3facb2333c895ada205 (patch)
tree9e0cbd81f0b2e9f0d5739275507aea2ecb9115b8 /src/file.cpp
parent9a30a663e472774a45b78b3240f6a399637992fc (diff)
downloadlibbu++-2a943828287d2a861930d3facb2333c895ada205.tar.gz
libbu++-2a943828287d2a861930d3facb2333c895ada205.tar.bz2
libbu++-2a943828287d2a861930d3facb2333c895ada205.tar.xz
libbu++-2a943828287d2a861930d3facb2333c895ada205.zip
Finally rearranged the system to put all compatability files in a directory
called compat. I've updated the linux and windows builds and it looks pretty good. I also added a config.h file which we have to edit by hand until I can work on build some more. Linux File operations now use 64 bit mode, windows can't, or at least, I don't feel like researching it right now.
Diffstat (limited to 'src/file.cpp')
-rw-r--r--src/file.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/file.cpp b/src/file.cpp
index 4d79f1e..f1f63e4 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -13,13 +13,19 @@
13#include <unistd.h> 13#include <unistd.h>
14#include <stdlib.h> // for mkstemp 14#include <stdlib.h> // for mkstemp
15 15
16#include "bu/config.h"
17
16namespace Bu { subExceptionDef( FileException ) } 18namespace Bu { subExceptionDef( FileException ) }
17 19
18Bu::File::File( const Bu::FString &sName, int iFlags ) : 20Bu::File::File( const Bu::FString &sName, int iFlags ) :
19 fd( -1 ), 21 fd( -1 ),
20 bEos( true ) 22 bEos( true )
21{ 23{
24#ifdef USE_64BIT_IO
25 fd = ::open64( sName.getStr(), getPosixFlags( iFlags ), 0666 );
26#else
22 fd = ::open( sName.getStr(), getPosixFlags( iFlags ), 0666 ); 27 fd = ::open( sName.getStr(), getPosixFlags( iFlags ), 0666 );
28#endif
23 if( fd < 0 ) 29 if( fd < 0 )
24 { 30 {
25 throw Bu::FileException( errno, "%s: %s", 31 throw Bu::FileException( errno, "%s: %s",