diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2014-07-22 16:39:01 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2014-07-22 16:39:01 +0000 |
| commit | 21a4337dc2f969dc3ec81e6ba3170119bcb67016 (patch) | |
| tree | af8077ea0e89ec29b499e46583f3de35d1b3103c /src/stable/file.cpp | |
| parent | 6482ec1f7550f0fca153bd8f556327902c7afec8 (diff) | |
| download | libbu++-21a4337dc2f969dc3ec81e6ba3170119bcb67016.tar.gz libbu++-21a4337dc2f969dc3ec81e6ba3170119bcb67016.tar.bz2 libbu++-21a4337dc2f969dc3ec81e6ba3170119bcb67016.tar.xz libbu++-21a4337dc2f969dc3ec81e6ba3170119bcb67016.zip | |
Deferred erase now works on cache entries. You can erase a cache entry while
it still has active references, and it will be safely cleaned up when the last
reference is released.
Diffstat (limited to 'src/stable/file.cpp')
| -rw-r--r-- | src/stable/file.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/stable/file.cpp b/src/stable/file.cpp index b551d24..35933f1 100644 --- a/src/stable/file.cpp +++ b/src/stable/file.cpp | |||
| @@ -240,7 +240,7 @@ void Bu::File::setSize( Bu::size iSize ) | |||
| 240 | 240 | ||
| 241 | Bu::size Bu::File::getSize() const | 241 | Bu::size Bu::File::getSize() const |
| 242 | { | 242 | { |
| 243 | struct stat st; | 243 | struct ::stat st; |
| 244 | fstat( fd, &st ); | 244 | fstat( fd, &st ); |
| 245 | return st.st_size; | 245 | return st.st_size; |
| 246 | } | 246 | } |
| @@ -250,7 +250,7 @@ Bu::size Bu::File::getBlockSize() const | |||
| 250 | #ifdef WIN32 | 250 | #ifdef WIN32 |
| 251 | return 4096; | 251 | return 4096; |
| 252 | #else | 252 | #else |
| 253 | struct stat st; | 253 | struct ::stat st; |
| 254 | fstat( fd, &st ); | 254 | fstat( fd, &st ); |
| 255 | return st.st_blksize; | 255 | return st.st_blksize; |
| 256 | #endif | 256 | #endif |
| @@ -261,6 +261,11 @@ Bu::String Bu::File::getLocation() const | |||
| 261 | return "to be implemented"; | 261 | return "to be implemented"; |
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | void Bu::File::stat( struct ::stat *pStat ) | ||
| 265 | { | ||
| 266 | fstat( fd, pStat ); | ||
| 267 | } | ||
| 268 | |||
| 264 | #ifndef WIN32 | 269 | #ifndef WIN32 |
| 265 | void Bu::File::chmod( mode_t t ) | 270 | void Bu::File::chmod( mode_t t ) |
| 266 | { | 271 | { |
