diff options
Diffstat (limited to '')
| -rw-r--r-- | src/file.cpp | 7 |
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 | ||
| 15 | namespace Bu { subExceptionDef( FileException ) } | 16 | namespace 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 |
| 154 | Bu::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 | } | ||
| 153 | void Bu::File::truncate( long nSize ) | 160 | void Bu::File::truncate( long nSize ) |
| 154 | { | 161 | { |
| 155 | ftruncate( fd, nSize ); | 162 | ftruncate( fd, nSize ); |
