Re: Polished FileSystem API proposal

And here's an example:

// Copy the 1th byte of file1.bin to file2.bin
navigator.getFilesystem().then(function(root) {
  return root.openWrite(["file1.bin", "file2.bin"]);
}).then(function(handles) {
  return handles[0].read(1);
}).then(function(buffer) {
  return handles[1].write(buffer);
});

On Mon, Jul 22, 2013 at 8:18 PM, Jan Varga <jan.varga@gmail.com> wrote:

> On Sat, Jul 13, 2013 at 2:31 AM, Jonas Sicking <jonas@sicking.cc> wrote:
>
>> Hi All,
>>
>> Yesterday a few of us at mozilla went through the FileSystem API
>> proposal we previously sent [1] and tightened it up.
>>
>>
> It was also pointed out that we should address multi-file locking too.
> One of the options is to make openRead() and openWrite() take a sequence.
>
> interface Directory {
>   Promise<FileHandle> openRead((DOMString or File) file);
>    Promise<FileHandleWritable> openWrite((DOMString or File) file,
> OpenWriteOptions options);
>   Promise<sequence<FileHandle>> openRead(sequence<(DOMString or File)>
> files);
>   Promise<sequence<FileHandleWritable>> openWrite(sequence<(DOMString or
> File)> files, OpenWriteOptions options);
> }
>
> So, this works with the current proposal, Jonas has a more complex
> solution that probably requires bigger changes in the proposed file system
> API.
> I'll let Jonas to describe it.
>
> Jan
>
>

Received on Monday, 22 July 2013 18:25:21 UTC