diff options
author | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-18 00:42:48 +0000 |
---|---|---|
committer | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-18 00:42:48 +0000 |
commit | 85786f935163dd4c46dc2931111189e8d119d4d8 (patch) | |
tree | 41c674929dc600ac070fed446013754d87e34b83 /base/file_util_win.cc | |
parent | 0effc1cb2317bc1e6ae41a8a1b831921e45d62bd (diff) | |
download | chromium_src-85786f935163dd4c46dc2931111189e8d119d4d8.zip chromium_src-85786f935163dd4c46dc2931111189e8d119d4d8.tar.gz chromium_src-85786f935163dd4c46dc2931111189e8d119d4d8.tar.bz2 |
Retrial of the first step to port file_util::CountFilesCreatedAfter()
Submitting http://codereview.chromium.org/75033 on behalf of hamaji
Review URL: http://codereview.chromium.org/67276
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13993 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_win.cc')
-rw-r--r-- | base/file_util_win.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/base/file_util_win.cc b/base/file_util_win.cc index 841cd28..8b3d4f5 100644 --- a/base/file_util_win.cc +++ b/base/file_util_win.cc @@ -14,6 +14,7 @@ #include "base/logging.h" #include "base/scoped_handle.h" #include "base/string_util.h" +#include "base/time.h" #include "base/win_util.h" namespace file_util { @@ -39,12 +40,14 @@ bool AbsolutePath(FilePath* path) { return true; } -int CountFilesCreatedAfter(const std::wstring& path, - const FILETIME& comparison_time) { +int CountFilesCreatedAfter(const FilePath& path, + const base::Time& comparison_time) { int file_count = 0; + FILETIME comparison_filetime(comparison_time.ToFileTime()); WIN32_FIND_DATA find_file_data; - std::wstring filename_spec = path + L"\\*"; // All files in given dir + // All files in given dir + std::wstring filename_spec = path.Append(L"*").value(); HANDLE find_handle = FindFirstFile(filename_spec.c_str(), &find_file_data); if (find_handle != INVALID_HANDLE_VALUE) { do { @@ -54,7 +57,7 @@ int CountFilesCreatedAfter(const std::wstring& path, continue; long result = CompareFileTime(&find_file_data.ftCreationTime, - &comparison_time); + &comparison_filetime); // File was created after or on comparison time if ((result == 1) || (result == 0)) ++file_count; |