diff options
author | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-26 01:04:08 +0000 |
---|---|---|
committer | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-26 01:04:08 +0000 |
commit | f5e3da4d564980a048f375cf1a824a01df03382a (patch) | |
tree | 68a0562ee30146d65071d722744503d47255dec4 /base/file_util.cc | |
parent | ec9207d3a86ed6ccbefc56d95034897f48f52674 (diff) | |
download | chromium_src-f5e3da4d564980a048f375cf1a824a01df03382a.zip chromium_src-f5e3da4d564980a048f375cf1a824a01df03382a.tar.gz chromium_src-f5e3da4d564980a048f375cf1a824a01df03382a.tar.bz2 |
Add file_util::GetFileInfo as a means to provide more information about a file
path. This CL changes GetFileSize to be implemented in terms of GetFileInfo
since under the hood on all platforms the same system call is used.
R=mark
Review URL: http://codereview.chromium.org/4286
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2624 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.cc')
-rw-r--r-- | base/file_util.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/base/file_util.cc b/base/file_util.cc index 0d6fab1..bec910b 100644 --- a/base/file_util.cc +++ b/base/file_util.cc @@ -290,5 +290,13 @@ bool ReadFileToString(const std::wstring& path, std::string* contents) { return true; } +bool GetFileSize(const std::wstring& file_path, int64* file_size) { + FileInfo info; + if (!GetFileInfo(file_path, &info)) + return false; + *file_size = info.size; + return true; +} + } // namespace |