Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clear HTML5 Filesystem API

How does one completely empty (or delete all files in) a filesystem?

Is there no 1 line solution like localStorage (localStorage.clear())? Or am I missing something really, really obvious?

Apparently, I wasn't very clear. I'm referring to the HTML5 Filesystem API. http://www.html5rocks.com/en/tutorials/file/filesystem/

like image 987
J. Chase Avatar asked Apr 14 '12 22:04

J. Chase


2 Answers

2016 Update: The File API "Directories and System" effort has been abandoned and what little support had made it into browsers is being dropped. The original File API is still valid, but the stuff providing an entire file area on the user's system has been abandoned.


It looks like DirectoryEntry#removeRecursively does that. It says you can't remove the root of a file system, but you can loop through the entries in the root and remove them recursively (or just always work with a subdirectory of the root, thereby letting you remove that with a one-liner).

like image 124
T.J. Crowder Avatar answered Nov 04 '22 10:11

T.J. Crowder


Not a one line solution but you can always go to

chrome://settings/cookies

and remove the file system from the origin of your choice enter image description here

like image 42
Thomas Luechtefeld Avatar answered Nov 04 '22 12:11

Thomas Luechtefeld