| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/test_file_util.h" | 5 #include "base/test_file_util.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fts.h> | 8 #include <fts.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
| 16 #include "base/file_util.h" | 16 #include "base/file_util.h" |
| 17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
| 18 | 18 |
| 19 namespace file_util { | 19 namespace file_util { |
| 20 | 20 |
| 21 bool DieFileDie(const FilePath& file, bool recurse) { |
| 22 // There is no need to workaround Windows problems on POSIX. |
| 23 // Just pass-through. |
| 24 return file_util::Delete(file, recurse); |
| 25 } |
| 26 |
| 21 bool CopyRecursiveDirNoCache(const std::wstring& source_dir, | 27 bool CopyRecursiveDirNoCache(const std::wstring& source_dir, |
| 22 const std::wstring& dest_dir) { | 28 const std::wstring& dest_dir) { |
| 23 const FilePath from_path(FilePath::FromWStringHack(source_dir)); | 29 const FilePath from_path(FilePath::FromWStringHack(source_dir)); |
| 24 const FilePath to_path(FilePath::FromWStringHack(dest_dir)); | 30 const FilePath to_path(FilePath::FromWStringHack(dest_dir)); |
| 25 | 31 |
| 26 char top_dir[PATH_MAX]; | 32 char top_dir[PATH_MAX]; |
| 27 if (base::strlcpy(top_dir, from_path.value().c_str(), | 33 if (base::strlcpy(top_dir, from_path.value().c_str(), |
| 28 arraysize(top_dir)) >= arraysize(top_dir)) { | 34 arraysize(top_dir)) >= arraysize(top_dir)) { |
| 29 return false; | 35 return false; |
| 30 } | 36 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 115 } |
| 110 | 116 |
| 111 if (error) { | 117 if (error) { |
| 112 LOG(ERROR) << strerror(error); | 118 LOG(ERROR) << strerror(error); |
| 113 return false; | 119 return false; |
| 114 } | 120 } |
| 115 return true; | 121 return true; |
| 116 } | 122 } |
| 117 | 123 |
| 118 } // namespace file_util | 124 } // namespace file_util |
| OLD | NEW |