Skip to content

Directory.deleteRecursively fails if the directory contains symlinks #2646

Closed
@munificent

Description

@munificent

Reproduce:

$ cat temp.dart

import('dart:io');

main() => new Directory('foo').deleteRecursivelySync();
$ mkdir foo
$ cd foo
$ ln -s ../temp.dart whatever
$ cd ..
$ dart temp.dart

Error:

Unhandled exception:
DirectoryIOException: Deletion failed, path = foo (OS Error: Directory not empty, errno = 66)
 0. Function: '[email protected]' url: 'dart:io' line:669 col:7
 1. Function: '::main' url: 'file:///.../temp.dart' line:2 col:53

Expected Result:

I'd like it to delete the directory, but not step into those symlinks and delete what they point to. Just delete the symlink files themselves.

Metadata

Metadata

Assignees

Labels

area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.closed-duplicateClosed in favor of an existing reportlibrary-io

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions