| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
| 7 | 7 |
| 8 #include "bin/file.h" | 8 #include "bin/file.h" |
| 9 | 9 |
| 10 #include <fcntl.h> // NOLINT | 10 #include <fcntl.h> // NOLINT |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 bool File::IsAbsolutePath(const char* pathname) { | 502 bool File::IsAbsolutePath(const char* pathname) { |
| 503 // Should we consider network paths? | 503 // Should we consider network paths? |
| 504 if (pathname == NULL) return false; | 504 if (pathname == NULL) return false; |
| 505 return (strlen(pathname) > 2) && | 505 return (strlen(pathname) > 2) && |
| 506 (pathname[1] == ':') && | 506 (pathname[1] == ':') && |
| 507 (pathname[2] == '\\' || pathname[2] == '/'); | 507 (pathname[2] == '\\' || pathname[2] == '/'); |
| 508 } | 508 } |
| 509 | 509 |
| 510 | 510 |
| 511 char* File::GetCanonicalPath(const char* pathname) { | 511 char* File::GetCanonicalPath(const char* pathname) { |
| 512 struct _stat st; | |
| 513 const wchar_t* system_name = StringUtils::Utf8ToWide(pathname); | 512 const wchar_t* system_name = StringUtils::Utf8ToWide(pathname); |
| 514 HANDLE file_handle = CreateFileW( | 513 HANDLE file_handle = CreateFileW( |
| 515 system_name, | 514 system_name, |
| 516 0, | 515 0, |
| 517 FILE_SHARE_READ, | 516 FILE_SHARE_READ, |
| 518 NULL, | 517 NULL, |
| 519 OPEN_EXISTING, | 518 OPEN_EXISTING, |
| 520 FILE_FLAG_BACKUP_SEMANTICS, | 519 FILE_FLAG_BACKUP_SEMANTICS, |
| 521 NULL); | 520 NULL); |
| 522 if (file_handle == INVALID_HANDLE_VALUE) { | 521 if (file_handle == INVALID_HANDLE_VALUE) { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 return kIdentical; | 645 return kIdentical; |
| 647 } else { | 646 } else { |
| 648 return kDifferent; | 647 return kDifferent; |
| 649 } | 648 } |
| 650 } | 649 } |
| 651 | 650 |
| 652 } // namespace bin | 651 } // namespace bin |
| 653 } // namespace dart | 652 } // namespace dart |
| 654 | 653 |
| 655 #endif // defined(TARGET_OS_WINDOWS) | 654 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |