Re: Request for feedback: Filesystem API

On Fri, Aug 9, 2013 at 11:24 PM, Jonas Sicking <jonas@sicking.cc> wrote:
> On Fri, Aug 9, 2013 at 7:25 PM, Domenic Denicola
> <domenic@domenicdenicola.com> wrote:
>> - At a glance, move, copy, removeDeep, and enumerateDeep seem like derivative APIs.

Actually, another piece of syntax sugar that you did not comment on,
but that I listed in the "open questions" section is the Directory
interface.

One way to simplify the API is to remove the Directory abstraction and
instead let all the interactions happen through some object
representing the root.

Another way that I forgot to mention is that the "(DOMString or
Directory or DestinationDict)" unions for "dest" argument in move()
and copy() is a bit excessive. It lets you do any of

dir.move(file, "newname.txt");
dir.move(file, destDir);
dir.move(file, { name: "newname.txt", dir: destDir);

But we could arguably simplify that and only allow the dictionary syntax. I.e.

dir.move(file, { name: "newname.txt" });
dir.move(file, { dir: destDir });
dir.move(file, { name: "newname.txt", dir: destDir });

/ Jonas

Received on Saturday, 10 August 2013 07:52:59 UTC