| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 return; | 76 return; |
| 77 } | 77 } |
| 78 var socket = new _RawSocket(new _NativeSocket.watch(socketId)); | 78 var socket = new _RawSocket(new _NativeSocket.watch(socketId)); |
| 79 _subscription = socket.expand((event) { | 79 _subscription = socket.expand((event) { |
| 80 bool stop = false; | 80 bool stop = false; |
| 81 var events = []; | 81 var events = []; |
| 82 var pair = {}; | 82 var pair = {}; |
| 83 if (event == RawSocketEvent.READ) { | 83 if (event == RawSocketEvent.READ) { |
| 84 String getPath(event) { | 84 String getPath(event) { |
| 85 var path = _path; | 85 var path = _path; |
| 86 if (event[2] != null) { | 86 if (event[2] != null && event[2].isNotEmpty) { |
| 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(getPath(event)); | 95 return FileSystemEntity.isDirectorySync(getPath(event)); |
| 96 } | 96 } |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |