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

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

Issue 12691002: dart:io | Add Link class, as sibling to File and Directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Implement Link.CreateSync, use it in file_system_links_test. Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « runtime/bin/file_patch.dart ('k') | sdk/lib/io/file_impl.dart » ('j') | sdk/lib/io/link.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698