Skip to content

Directory.deleteRecursively fails if the directory contains symlinks #2646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
munificent opened this issue Apr 19, 2012 · 4 comments
Closed
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-duplicate Closed in favor of an existing report library-io

Comments

@munificent
Copy link
Member

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.

@madsager
Copy link
Contributor

Yes, symlinks are not yet handled in the File and Directory APIs. There are a couple of bugs on this. Unifying into one bug.


Added Duplicate label.
Marked as being merged into #2516.

@munificent
Copy link
Member Author

Thanks!

@DartBot
Copy link

DartBot commented May 13, 2012

This comment was originally written by @financecoding


Looks like I might of duplicate file this bug here http://code.google.com/p/dart/issues/detail?id=3031

@kevmoo
Copy link
Member

kevmoo commented May 14, 2014

Removed Area-IO label.
Added Area-Library, Library-IO labels.

@munificent munificent added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io closed-duplicate Closed in favor of an existing report labels May 14, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-duplicate Closed in favor of an existing report library-io
Projects
None yet
Development

No branches or pull requests

4 participants