Skip to content
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

removeDirectory and symlinks #2

Closed
gracjan opened this issue Jun 10, 2014 · 4 comments
Closed

removeDirectory and symlinks #2

gracjan opened this issue Jun 10, 2014 · 4 comments
Assignees
Labels
type: x-intended-behavior The described behavior is working as intended.

Comments

@gracjan
Copy link
Contributor

gracjan commented Jun 10, 2014

Prelude System.Directory> :!mkdir "a-directory"
Prelude System.Directory> :!ln -s "a-directory" "a-symlink-to-a-directory"
Prelude System.Directory> doesDirectoryExist "a-symlink-to-a-directory"
True
Prelude System.Directory> removeDirectory "a-symlink-to-a-directory"
*** Exception: a-symlink-to-a-directory: removeDirectory: inappropriate type (Not a directory)
@hvr hvr added the blocked: need-more-info Progress cannot be made without additional information from the reporter. label Dec 19, 2014
@hvr
Copy link
Member

hvr commented Dec 19, 2014

...what should happen instead?

@ezyang
Copy link

ezyang commented Jan 6, 2015

Well, this behavior is at least consistent with how Python's os.rmdir and os.path.isdir operate.

@argiopetech argiopetech self-assigned this Feb 18, 2015
@argiopetech
Copy link
Contributor

This is also consistent with the way the GNU coreutils operate:

$ mkdir a-directory
$ ln -s a-directory a-symlink-to-a-directory
$ test -d a-directory/
$ echo $?
0
$ test -d a-symlink-to-a-directory/
$ echo $?
0
$ rmdir a-symlink-to-a-directory
rmdir: failed to remove ‘a-symlink-to-a-directory’: Not a directory

Pending a compelling reason to change the behavior of removeDirectory, I'm going to close this issue.

@gracjan
Copy link
Contributor Author

gracjan commented Feb 18, 2015

Agree.

@Rufflewind Rufflewind added type: x-intended-behavior The described behavior is working as intended. and removed blocked: need-more-info Progress cannot be made without additional information from the reporter. labels Dec 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: x-intended-behavior The described behavior is working as intended.
Projects
None yet
Development

No branches or pull requests

5 participants