| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 const wchar_t* system_name = StringUtils::Utf8ToWide(name); | 147 const wchar_t* system_name = StringUtils::Utf8ToWide(name); |
| 148 int fd = _wopen(system_name, O_RDONLY | O_CREAT, 0666); | 148 int fd = _wopen(system_name, O_RDONLY | O_CREAT, 0666); |
| 149 free(const_cast<wchar_t*>(system_name)); | 149 free(const_cast<wchar_t*>(system_name)); |
| 150 if (fd < 0) { | 150 if (fd < 0) { |
| 151 return false; | 151 return false; |
| 152 } | 152 } |
| 153 return (close(fd) == 0); | 153 return (close(fd) == 0); |
| 154 } | 154 } |
| 155 | 155 |
| 156 | 156 |
| 157 bool File::CreateLink(const char* name, const char* target) { |
| 158 // TODO(whesse): Implement Junction creation. |
| 159 return false; |
| 160 } |
| 161 |
| 162 |
| 157 bool File::Delete(const char* name) { | 163 bool File::Delete(const char* name) { |
| 158 const wchar_t* system_name = StringUtils::Utf8ToWide(name); | 164 const wchar_t* system_name = StringUtils::Utf8ToWide(name); |
| 159 int status = _wremove(system_name); | 165 int status = _wremove(system_name); |
| 160 free(const_cast<wchar_t*>(system_name)); | 166 free(const_cast<wchar_t*>(system_name)); |
| 161 if (status == -1) { | 167 if (status == -1) { |
| 162 return false; | 168 return false; |
| 163 } | 169 } |
| 164 return true; | 170 return true; |
| 165 } | 171 } |
| 166 | 172 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 // socket code will handle the different handle types. | 275 // socket code will handle the different handle types. |
| 270 return kPipe; | 276 return kPipe; |
| 271 } | 277 } |
| 272 | 278 |
| 273 | 279 |
| 274 File::Type File::GetType(const char* pathname, bool follow_links) { | 280 File::Type File::GetType(const char* pathname, bool follow_links) { |
| 275 return File::kDoesNotExist; | 281 return File::kDoesNotExist; |
| 276 } | 282 } |
| 277 | 283 |
| 278 #endif // defined(TARGET_OS_WINDOWS) | 284 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |