[Pharo-users] Why DirectoryIsNotEmpty on FileReference>>deleteAll ?
akgrant0710 at gmail.com
Sat Feb 2 13:35:07 EST 2019
On Fri, 1 Feb 2019 at 19:50, Albrecht Baur via Pharo-users
<pharo-users at lists.pharo.org> wrote:
> I get a DirectoryIsNotEmpty exception on
> But deleteAll is supposed to delete children too. -> So why the exception ?
This is a bug in the FilePlugin. When deleting directories it is
leaving the deleted directory open. On Unix this is OK, the entry is
removed from the parent directory and actually deleted when the file
is closed. I assume that because CIFS is a windows protocol it
doesn't handle it, and leaves the entry there until closed, causing
the problems later on.
The problem can be reduced to the following code:
| root deleteMeFolder |
root := '/path/to/cifs' asFileReference.
deleteMeFolder := root / 'delme'.
$ sudo lsof | grep delme
and you'll see the deleted entries.
More information about the Pharo-users