diff options
author | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-30 23:54:04 +0000 |
---|---|---|
committer | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-30 23:54:04 +0000 |
commit | 640517fdd23e08ed95cf129d27457db817ee6124 (patch) | |
tree | 2674bc857b9d1b566e05bcfa1dd5c8cfd1897dbf /base/file_util_linux.cc | |
parent | f92ed219c9aeeed79993d1d32f34e5d5c9888dbe (diff) | |
download | chromium_src-640517fdd23e08ed95cf129d27457db817ee6124.zip chromium_src-640517fdd23e08ed95cf129d27457db817ee6124.tar.gz chromium_src-640517fdd23e08ed95cf129d27457db817ee6124.tar.bz2 |
Begin the first small step towards using FilePath everywhere:
- Add some transition APIs.
- Start migrating some code to transition APIs.
Review URL: http://codereview.chromium.org/8825
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4254 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_linux.cc')
-rw-r--r-- | base/file_util_linux.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/base/file_util_linux.cc b/base/file_util_linux.cc index 8c1a780..f776c91 100644 --- a/base/file_util_linux.cc +++ b/base/file_util_linux.cc @@ -9,6 +9,7 @@ #include <string> #include <vector> +#include "base/file_path.h" #include "base/logging.h" #include "base/string_util.h" @@ -16,21 +17,21 @@ namespace file_util { const wchar_t kPathSeparator = L'/'; -bool GetTempDir(std::wstring* path) { +bool GetTempDir(FilePath* path) { const char* tmp = getenv("TMPDIR"); if (tmp) - *path = UTF8ToWide(tmp); + *path = FilePath(tmp); else - *path = L"/tmp"; + *path = FilePath("/tmp"); return true; } -bool CopyFile(const std::wstring& from_path, const std::wstring& to_path) { - int infile = open(WideToUTF8(from_path).c_str(), O_RDONLY); +bool CopyFile(const FilePath& from_path, const FilePath& to_path) { + int infile = open(from_path.value().c_str(), O_RDONLY); if (infile < 0) return false; - int outfile = creat(WideToUTF8(to_path).c_str(), 0666); + int outfile = creat(to_path.value().c_str(), 0666); if (outfile < 0) { close(infile); return false; |