Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8005946 | 9 | Unassigned | P4 | Closed | Cannot Reproduce |
Deletion of a file directory on macOS is unreliable. This problem is typically seen when deleting a file tree. The symptom of the problem is a failure to delete a directory after deleting the directory contents. The reported failure is that the directory is not empty. The directory is not empty because it contains a .DS_Store file created by the Finder using a background thread that is triggered by FSEvents. This Finder behavior is enabled by viewing an ancestor directory with the Calculate All Sizes view option enabled. The .DS_Store file is used to cache the cumulative size of each directory in the viewed tree.
One could rightly call this behavior a macOS bug. It affects even basic Unix commands such as rm -rf. However, this behavior has existed for many years (it was reported in 2013, see linked issue) and there is no sign of the problem being fixed anytime soon.
A suggested workaround is to consider a .DS_Store file a "special file" whose existence does not make the directory "non empty" for the purpose of directory deletion. This change would need to be implemented in the JDK because it is not implemented by the file system.
One could rightly call this behavior a macOS bug. It affects even basic Unix commands such as rm -rf. However, this behavior has existed for many years (it was reported in 2013, see linked issue) and there is no sign of the problem being fixed anytime soon.
A suggested workaround is to consider a .DS_Store file a "special file" whose existence does not make the directory "non empty" for the purpose of directory deletion. This change would need to be implemented in the JDK because it is not implemented by the file system.
- backported by
-
JDK-8005946 Mac build problems with .DS_Store files
-
- Closed
-