gpt4 book ai didi

javascript - HTML5 文件系统 API

转载 作者:太空狗 更新时间:2023-10-29 15:05:22 27 4
gpt4 key购买 nike

我已经通过文件系统 API 创建了文件 'log.txt'

function initFS(grantedBytes) {
window.requestFileSystem(window.PERSISTENT, grantedBytes, function (filesystem) {
fs = filesystem;

fs.root.getFile('log.txt', { create: true, exclusive: true }, function (fileEntry) {

// fileEntry.isFile === true
// fileEntry.name == 'log.txt'
// fileEntry.fullPath == '/log.txt'
console.log(fileEntry.fullPath);



}, errorHandler);
}, errorHandler);
}

initFS(1024*1024);

并且没有完全理解它的结构。有没有办法探索这个文件例如从 Windows 资源管理器并在文件系统中查看它?

最佳答案

还有一个更简单的方法。在 Chrome 上,访问这些网址。
对于 http,它是 "filesystem:http://"+location.host+"/persistent/"
对于 https,它是 "filesystem:https://"+location.host+"/persistent/"

关于javascript - HTML5 文件系统 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19207464/

27 4 0
文章推荐: javascript - 如何使用 HTML5 样板中的 main.js 和 plugins.js?
文章推荐: c - C中的分而治之trominos算法
文章推荐: c - 重新分配返回 NULL
文章推荐: html - 使用 WebDriver 单击
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com