跳到主要内容

Web Spec Awesome


file system access

entries api

window.requestFileSystem ||= window.webkitRequestFileSystem;
window.directoryEntry ||= window.webkitDirectoryEntry;

function onFs(fs) {
fs.root.getDirectory(
'Documents',
{ create: true },
function (directoryEntry) {
//directoryEntry.isFile === false
//directoryEntry.isDirectory === true
//directoryEntry.name === 'Documents'
//directoryEntry.fullPath === '/Documents'
},
onError,
);
}
function onError(e) {
console.error(e);
}
// Opening a file system with temporary storage
window.requestFileSystem(TEMPORARY, 1024 * 1024 /*1MB*/, onFs, onError);

FileAPI