aboutsummaryrefslogtreecommitdiff
path: root/src/file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/file.cpp')
-rw-r--r--src/file.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/file.cpp b/src/file.cpp
index 5049bbb..417c445 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -11,6 +11,7 @@
11#include <sys/stat.h> 11#include <sys/stat.h>
12#include <fcntl.h> 12#include <fcntl.h>
13#include <unistd.h> 13#include <unistd.h>
14#include <stdlib.h> // for mkstemp
14 15
15namespace Bu { subExceptionDef( FileException ) } 16namespace Bu { subExceptionDef( FileException ) }
16 17
@@ -150,6 +151,12 @@ void Bu::File::setBlocking( bool bBlocking )
150} 151}
151 152
152#ifndef WIN32 153#ifndef WIN32
154Bu::File Bu::File::tempFile( Bu::FString &sName, int /*iFlags*/ )
155{
156 int afh_d = mkstemp( sName.getStr() );
157
158 return Bu::File( afh_d );
159}
153void Bu::File::truncate( long nSize ) 160void Bu::File::truncate( long nSize )
154{ 161{
155 ftruncate( fd, nSize ); 162 ftruncate( fd, nSize );