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

Side by Side Diff: runtime/bin/directory_fuchsia.cc

Issue 2591523002: Fuchsia: Adds File::Copy() (Closed)
Patch Set: Address comments Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/bin/file_fuchsia.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_FUCHSIA) 6 #if defined(TARGET_OS_FUCHSIA)
7 7
8 #include "bin/directory.h" 8 #include "bin/directory.h"
9 9
10 #include <dirent.h> // NOLINT 10 #include <dirent.h> // NOLINT
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 348
349 349
350 bool Directory::Delete(const char* dir_name, bool recursive) { 350 bool Directory::Delete(const char* dir_name, bool recursive) {
351 if (!recursive) { 351 if (!recursive) {
352 if ((File::GetType(dir_name, false) == File::kIsLink) && 352 if ((File::GetType(dir_name, false) == File::kIsLink) &&
353 (File::GetType(dir_name, true) == File::kIsDirectory)) { 353 (File::GetType(dir_name, true) == File::kIsDirectory)) {
354 return NO_RETRY_EXPECTED(unlink(dir_name)) == 0; 354 return NO_RETRY_EXPECTED(unlink(dir_name)) == 0;
355 } 355 }
356 return NO_RETRY_EXPECTED(rmdir(dir_name)) == 0; 356 return NO_RETRY_EXPECTED(rmdir(dir_name)) == 0;
357 } else { 357 } else {
358 // TODO(MG-416): After the issue is addressed, this can use the same code
359 // as on Linux, etc.
358 UNIMPLEMENTED(); 360 UNIMPLEMENTED();
359 return false; 361 return false;
360 } 362 }
361 } 363 }
362 364
363 365
364 bool Directory::Rename(const char* path, const char* new_path) { 366 bool Directory::Rename(const char* path, const char* new_path) {
365 ExistsResult exists = Exists(path); 367 ExistsResult exists = Exists(path);
366 if (exists != EXISTS) { 368 if (exists != EXISTS) {
367 return false; 369 return false;
368 } 370 }
369 return (NO_RETRY_EXPECTED(rename(path, new_path)) == 0); 371 return (NO_RETRY_EXPECTED(rename(path, new_path)) == 0);
370 } 372 }
371 373
372 } // namespace bin 374 } // namespace bin
373 } // namespace dart 375 } // namespace dart
374 376
375 #endif // defined(TARGET_OS_FUCHSIA) 377 #endif // defined(TARGET_OS_FUCHSIA)
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/file_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698