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

Files.deleteRecursively method fails on Mac OS in typical use case scenario #359

Closed
gissuebot opened this issue Oct 31, 2014 · 7 comments
Closed
Labels
status=duplicate type=defect Bug, not working as expected

Comments

@gissuebot
Copy link

Original issue created by hshsce on 2010-05-12 at 09:22 AM


What steps will reproduce the problem?

  1. File dir = Files.createTempDir(); (e.g. unit test set up)
  2. fill dir with some random files
  3. Files.deleteRecursively(dir); (e.g. unit test tear down).

What is the expected output? What do you see instead?

I expect directory to be deleted. IOExceptio is thrown instead

What version of the product are you using? On what operating system?

guava-io r03 from maven repository

uname -a
Darwin foo.lan 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26 11:58:09 PST 2010; root:xnu-
1504.3.12~1/RELEASE_I386 i386

Please provide any additional information below.

I suspect that IOException is thrown because non empty directory cannot be deleted. It is non
empty because Files.deleteDirectoryContents() method stopped silently without any action after
detecting symbolic link. In fact on my Mac OS the /tmp dir is linked with symbolic link to
/private/tmp dir.

@gissuebot
Copy link
Author

Original comment posted by kevinb@google.com on 2010-07-30 at 03:56 AM


(No comment entered for this change.)


Labels: -Priority-Medium

@gissuebot
Copy link
Author

Original comment posted by ikaraszi on 2010-11-19 at 12:58 PM


I have the same issue

@gissuebot
Copy link
Author

Original comment posted by Randgalt on 2011-01-26 at 07:13 PM


the problem is this line of code in deleteDirectoryContents()

if (!directory.getCanonicalPath().equals(directory.getAbsolutePath())) {
  return;
}

@gissuebot
Copy link
Author

Original comment posted by fry@google.com on 2011-01-28 at 04:12 PM


(No comment entered for this change.)


Status: Accepted

@gissuebot
Copy link
Author

Original comment posted by kevinb@google.com on 2011-07-13 at 06:18 PM


(No comment entered for this change.)


Status: Triaged

@gissuebot
Copy link
Author

Original comment posted by cpovirk@google.com on 2011-07-21 at 06:25 PM


(No comment entered for this change.)


Status: Duplicate
Merged Into: #365

@deeTEEcee
Copy link

I get com.google.common.io.InsecureRecursiveDeleteException: /var/folders/ys/8kxkb4yd6tv1vcyh7y16_zrc0000gn/T/data-2188147556886190201: unable to guarantee security of recursive delete on mac right now. I know there's an option for "insecure" but I didn't seem to see anyone else on the web with this same issue and preferred not to add it since our servers run this on linux anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status=duplicate type=defect Bug, not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants