diff options
Diffstat (limited to 'base/file_util.cc')
-rw-r--r-- | base/file_util.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/base/file_util.cc b/base/file_util.cc index 5bc73ce..aea6e62 100644 --- a/base/file_util.cc +++ b/base/file_util.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -194,6 +194,15 @@ bool ReadFileToString(const FilePath& path, std::string* contents) { return true; } +bool IsDirectoryEmpty(const FilePath& dir_path) { + FileEnumerator files(dir_path, false, + static_cast<FileEnumerator::FILE_TYPE>( + FileEnumerator::FILES | FileEnumerator::DIRECTORIES)); + if (files.Next().value().empty()) + return true; + return false; +} + FILE* CreateAndOpenTemporaryFile(FilePath* path) { FilePath directory; if (!GetTempDir(&directory)) |