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 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 static final Map<int, _WatcherPath> _idMap = {}; | 57 static final Map<int, _WatcherPath> _idMap = {}; |
58 | 58 |
59 final String _path; | 59 final String _path; |
60 final int _events; | 60 final int _events; |
61 final bool _recursive; | 61 final bool _recursive; |
62 | 62 |
63 _WatcherPath _watcherPath; | 63 _WatcherPath _watcherPath; |
64 | 64 |
65 StreamController _broadcastController; | 65 StreamController _broadcastController; |
66 | 66 |
67 /* patch */ static Stream<FileSystemEvent> watch( | 67 /* patch */ static Stream<FileSystemEvent> _watch( |
68 String path, int events, bool recursive) { | 68 String path, int events, bool recursive) { |
69 if (Platform.isLinux) { | 69 if (Platform.isLinux) { |
70 return new _InotifyFileSystemWatcher(path, events, recursive).stream; | 70 return new _InotifyFileSystemWatcher(path, events, recursive).stream; |
71 } | 71 } |
72 if (Platform.isWindows) { | 72 if (Platform.isWindows) { |
73 return new _Win32FileSystemWatcher(path, events, recursive).stream; | 73 return new _Win32FileSystemWatcher(path, events, recursive).stream; |
74 } | 74 } |
75 if (Platform.isMacOS) { | 75 if (Platform.isMacOS) { |
76 return new _FSEventStreamFileSystemWatcher( | 76 return new _FSEventStreamFileSystemWatcher( |
77 path, events, recursive).stream; | 77 path, events, recursive).stream; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 void _pathWatchedEnd() { | 361 void _pathWatchedEnd() { |
362 _subscription.cancel(); | 362 _subscription.cancel(); |
363 _controller.close(); | 363 _controller.close(); |
364 } | 364 } |
365 } | 365 } |
366 | 366 |
367 | 367 |
368 Uint8List _makeUint8ListView(Uint8List source, int offsetInBytes, int length) { | 368 Uint8List _makeUint8ListView(Uint8List source, int offsetInBytes, int length) { |
369 return new Uint8List.view(source.buffer, offsetInBytes, length); | 369 return new Uint8List.view(source.buffer, offsetInBytes, length); |
370 } | 370 } |
OLD | NEW |