parent
9f11077768
commit
b7ef11fa70
|
@ -210,12 +210,22 @@ File* File::OpenWithNoBuffering(const char* file_name, const char* mode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool File::Delete(const char* file_name) {
|
bool File::Delete(const char* file_name) {
|
||||||
|
static bool logged = false;
|
||||||
base::StringPiece real_file_name;
|
base::StringPiece real_file_name;
|
||||||
const FileTypeInfo* file_type = GetFileTypeInfo(file_name, &real_file_name);
|
const FileTypeInfo* file_type = GetFileTypeInfo(file_name, &real_file_name);
|
||||||
DCHECK(file_type);
|
DCHECK(file_type);
|
||||||
return file_type->delete_function
|
if (file_type->delete_function) {
|
||||||
? file_type->delete_function(real_file_name.data())
|
return file_type->delete_function(real_file_name.data());
|
||||||
: false;
|
} else {
|
||||||
|
if (!logged) {
|
||||||
|
logged = true;
|
||||||
|
LOG(WARNING) << "File::Delete: file type for "
|
||||||
|
<< file_name
|
||||||
|
<< " ('" << file_type->type << "') "
|
||||||
|
<< "has no 'delete' function.";
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t File::GetFileSize(const char* file_name) {
|
int64_t File::GetFileSize(const char* file_name) {
|
||||||
|
|
Loading…
Reference in New Issue