Skip to content

Commit 50f9dd8

Browse files
zichanggcommit-bot@chromium.org
authored andcommitted
Revert "[io] exclude links from isDirectory()"
This reverts commit 49d743f. Reason for revert: break vm-kernel-precomp-mac-release-simarm64 bot Original change's description: > [io] exclude links from isDirectory() > > isDirectory() should not return true for links. > > Bug: #35102 > Change-Id: I737345a581d6a50d7bccab0dbc10f1a31a57e219 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121900 > Commit-Queue: Zichang Guo <zichangguo@google.com> > Reviewed-by: Siva Annamalai <asiva@google.com> TBR=asiva@google.com,zichangguo@google.com Change-Id: I66ee7d3b3f0ae2bcf80b00e0f3c68bba3e520966 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: #35102 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122060 Reviewed-by: Zichang Guo <zichangguo@google.com> Commit-Queue: Zichang Guo <zichangguo@google.com>
1 parent d9fa27a commit 50f9dd8

File tree

3 files changed

+2
-29
lines changed

3 files changed

+2
-29
lines changed

sdk/lib/_internal/vm/bin/file_patch.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,7 @@ class _FileSystemWatcher {
217217
bool getIsDir(event) {
218218
if (Platform.isWindows) {
219219
// Windows does not get 'isDir' as part of the event.
220-
// Links should also be skipped.
221-
return FileSystemEntity.isDirectorySync(getPath(event)) &&
222-
!FileSystemEntity.isLinkSync(getPath(event));
220+
return FileSystemEntity.isDirectorySync(getPath(event));
223221
}
224222
return (event[0] & FileSystemEvent._isDir) != 0;
225223
}

sdk_nnbd/lib/_internal/vm/bin/file_patch.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,7 @@ class _FileSystemWatcher {
219219
bool getIsDir(event) {
220220
if (Platform.isWindows) {
221221
// Windows does not get 'isDir' as part of the event.
222-
// Links should also be skipped.
223-
return FileSystemEntity.isDirectorySync(getPath(event)) &&
224-
!FileSystemEntity.isLinkSync(getPath(event));
222+
return FileSystemEntity.isDirectorySync(getPath(event));
225223
}
226224
return (event[0] & FileSystemEvent._isDir) != 0;
227225
}

tests/standalone_2/io/link_test.dart

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -275,33 +275,10 @@ testRelativeLinksSync() {
275275
tempDirectory.deleteSync(recursive: true);
276276
}
277277

278-
testIsDir() async {
279-
Directory sandbox = Directory.systemTemp.createTempSync();
280-
Directory dir = new Directory(sandbox.path + Platform.pathSeparator + "dir");
281-
dir.createSync();
282-
File target = new File(sandbox.path + Platform.pathSeparator + "target");
283-
target.createSync();
284-
285-
final eventCompleter = new Completer<FileSystemEvent>();
286-
var subscription;
287-
subscription = dir.watch().listen((FileSystemEvent event) {
288-
eventCompleter.complete(event);
289-
subscription.cancel();
290-
});
291-
Link link = new Link(dir.path + Platform.pathSeparator + "link");
292-
link.createSync(target.path);
293-
final event = await eventCompleter.future;
294-
// Link should not be marked as Dir.
295-
Expect.isFalse(event.isDirectory);
296-
297-
sandbox.deleteSync(recursive: true);
298-
}
299-
300278
main() {
301279
testCreateSync();
302280
testCreateLoopingLink();
303281
testRenameSync();
304282
testLinkErrorSync();
305283
testRelativeLinksSync();
306-
testIsDir();
307284
}

0 commit comments

Comments
 (0)