W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2013

Re: Request for feedback: Filesystem API

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 20 Aug 2013 00:55:04 -0700
Message-ID: <CA+c2ei-Xw6KA40asihp=HyV41VauW+5EYOLR-yAC-amd+5qyxQ@mail.gmail.com>
To: Brendan Eich <brendan@secure.meer.net>
Cc: Domenic Denicola <domenic@domenicdenicola.com>, public-script-coord@w3.org
On Aug 20, 2013 12:03 AM, "Brendan Eich" <brendan@secure.meer.net> wrote:
>
> Jonas Sicking wrote:
>> I think protection of accidentally removing a non-empty directory
belongs in UI and not in API (Unix commands land somewhere in between)
>>
>
> Unix had directory removal at user-level initially, but moved to rmdir(2)
which can fail with ENOTEMPTY, to avoid the footgun (also to abstract at
the kernel boundary over future directory entry representations, but that
could've been done in libc code).
>
> Here I will join Allen in pointing to Unix history. It is best to have rm
-r (removeDeep) be the composite operation (enumerateDeep + remove) and
remove the primitive (which fails on a non-empty directory).

OK, so remove() will remove a file or an empty directory and is atomic. If
passed a non-empty directory it fails with a "directory not empty" error.

removeDeep(), if we keep it, is a composite operation which can either
remove a file or a directory, empty or not.

/ Jonas
Received on Tuesday, 20 August 2013 07:55:32 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:50 UTC