Thursday, May 8th, 2008

File API via mountpoint://

Category: Browsers, Standards

If you ‘aint got a URL scheme, you are a nobody. That is what I thought when I saw fx:// on the first day of JavaOne.

The newest one of these that I have seen is mountpoint:// which is part of an Opera proposal for a File I/O API in the browser. You know me, extending the browser is a bit of a passion, so I was excited to see what they had come up with:

Traditionally, web applications have had little to no access to resources residing on the local filesystem. The ECMAScript interfaces for file I/O specifies a sandboxed file system, where a widget or other trusted component can gain access to the local file system.

The File I/O interfaces in this specification represent an abstract filesystem, without knowledge of the underlying filesystem’s path separators, conventions for setting file properties such as read/write permissions.

The interfaces provide methods for opening files, writing to them, creating files and directories, moving or deleting them, and so forth.

In order to work with files, an application first has to acquire a mountpoint. A mountpoint is either a reference to a file or folder on a disk, or an abstract reference to a set of files which might not necessarily be within the same folder.

If your application wants to use the File I/O API, the browser user will be asked to select a location for the virtual file system, and then you will have access to play in the sandbox.

The core interfaces are:

The FileSystem interface

In a context where the FileSystem interface is made available to applications, the interface is instantiated as opera.io.filesystem. When present, this object provides attributes and methods for acquiring access to files and folders on the local filesystem.

The File interface

The File interface represents objects in a virtual filesystem, and can represent either a file or a folder. A file object consists of a number of properties, and methods for working on these objects

File objects that are marked as persistent must persist across restarts of the application.

The FileStream interface

The FileStream interface represents a File object opened for reading and/or writing, and defines methods and attributes for doing this work.

Posted by Dion Almaer at 11:18 am
2 Comments

+++--
3.9 rating from 14 votes

2 Comments »

Comments feed TrackBack URI

While i am not against a File API (i kinda like the virtual disk idea) they *reall* should open-source in pre-alpha stage so we will not have any surprises by master hackers…

Comment by SchizoDuckie — May 8, 2008

SchizoDuckie: Well, Opera proposed its File I/O API for standardization to the W3C and is really looking after feedback, especially on potential security issues.

Having access to the local file system is really interesting. It lowers the barrier to make “real” apps and opens a whole range of possibilites to web apps, in a standard and cross platform way. It’s good to finally see that.

Comment by p01 — May 8, 2008

Leave a comment

You must be logged in to post a comment.