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

Side by Side Diff: runtime/bin/file_patch.dart

Issue 47213007: Fix file-system-entity watching on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « no previous file | tests/standalone/io/file_system_watcher_test.dart » ('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) 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 patch class _File { 5 patch class _File {
6 /* patch */ static _exists(String path) native "File_Exists"; 6 /* patch */ static _exists(String path) native "File_Exists";
7 /* patch */ static _create(String path) native "File_Create"; 7 /* patch */ static _create(String path) native "File_Create";
8 /* patch */ static _createLink(String path, String target) 8 /* patch */ static _createLink(String path, String target)
9 native "File_CreateLink"; 9 native "File_CreateLink";
10 /* patch */ static _linkTarget(String path) native "File_LinkTarget"; 10 /* patch */ static _linkTarget(String path) native "File_LinkTarget";
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 var path = _path; 85 var path = _path;
86 if (event[2] != null) { 86 if (event[2] != null) {
87 path += Platform.pathSeparator; 87 path += Platform.pathSeparator;
88 path += event[2]; 88 path += event[2];
89 } 89 }
90 return path; 90 return path;
91 } 91 }
92 bool getIsDir(event) { 92 bool getIsDir(event) {
93 if (Platform.isWindows) { 93 if (Platform.isWindows) {
94 // Windows does not get 'isDir' as part of the event. 94 // Windows does not get 'isDir' as part of the event.
95 return FileSystemEntity.isDirectorySync(path); 95 return FileSystemEntity.isDirectorySync(getPath(event));
96 } 96 }
97 return (event[0] & FileSystemEvent._IS_DIR) != 0; 97 return (event[0] & FileSystemEvent._IS_DIR) != 0;
98 } 98 }
99 void add(event) { 99 void add(event) {
100 if ((event.type & _events) == 0) return; 100 if ((event.type & _events) == 0) return;
101 events.add(event); 101 events.add(event);
102 } 102 }
103 void rewriteMove(event, isDir) { 103 void rewriteMove(event, isDir) {
104 if (event[3]) { 104 if (event[3]) {
105 add(new FileSystemCreateEvent._(getPath(event), isDir)); 105 add(new FileSystemCreateEvent._(getPath(event), isDir));
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 int _watchPath(String path, int events, bool recursive) 174 int _watchPath(String path, int events, bool recursive)
175 native "FileSystemWatcher_WatchPath"; 175 native "FileSystemWatcher_WatchPath";
176 void _unwatchPath() native "FileSystemWatcher_UnwatchPath"; 176 void _unwatchPath() native "FileSystemWatcher_UnwatchPath";
177 List _readEvents() native "FileSystemWatcher_ReadEvents"; 177 List _readEvents() native "FileSystemWatcher_ReadEvents";
178 } 178 }
179 179
180 Uint8List _makeUint8ListView(Uint8List source, int offsetInBytes, int length) { 180 Uint8List _makeUint8ListView(Uint8List source, int offsetInBytes, int length) {
181 return new Uint8List.view(source.buffer, offsetInBytes, length); 181 return new Uint8List.view(source.buffer, offsetInBytes, length);
182 } 182 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/io/file_system_watcher_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698