Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1600)

Unified Diff: base/file_util_linux.cc

Issue 8825: Begin the first small step towards using FilePath everywhere: (Closed)
Patch Set: works on windows Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/file_util.cc ('k') | base/file_util_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_linux.cc
diff --git a/base/file_util_linux.cc b/base/file_util_linux.cc
index 8c1a7802f7d50b725b841d953ecca2260198a98d..f776c917b74a51f0da876eb808e0ab8b2dd0e284 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;
« no previous file with comments | « base/file_util.cc ('k') | base/file_util_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698