Clear HTML5 file system API

How to completely delete (or delete all files) in the file system?

Is there 1 linear solution like localStorage ( localStorage.clear() )? Or did I miss something really, really obvious?

Apparently, I was not very clear. I mean the HTML5 file system API. http://www.html5rocks.com/en/tutorials/file/filesystem/

+7
source share
4 answers

Update 2016 : The Catalogs and System API file has been abandoned and what little support it has made in browsers is discarded. The original File API is still valid, but material providing the entire file area on the user system has been left behind.


Looks like DirectoryEntry#removeRecursively does this. It says that you cannot delete the root of the file system, but you can scroll through the entries in the root and delete them recursively (or just always work with the root subdirectory, thereby allowing you to delete it using a single line).

+7
source

Not a one line solution, but you can always go to

chrome: // Settings / cookies

and delete the file system from the source of your choice enter image description here

+1
source

In bro-fs there is a special fs.clear () for this.

 fs.init() .then(() => fs.mkdir('dir')) .then(() => fs.writeFile('file.txt', 'hello world')) .then(() => fs.clear()) 
0
source
-one
source

All Articles