File api

243 views

Published on

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
243
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

File api

  1. 1. bdFileSystem API 工具集介绍 赵龙 2012-9-18
  2. 2. 本地存储实现方案• LocalStorage• LocalDataBase---Sqlite 标准,事务级别• IndexedDB--- 非关系型数据库,事务级别 ,是一种趋势。• File API• 其他
  3. 3. 为什么采用 FileSystem API• 相比 LocalStorage 有更大的存储空间• 生命周期更长• API 更加丰富• 由于标准不统一 Localdatabase 标准将来会 被 w3c 废除。• IndexedDB----bdBrowser 目前不支持。 So , only Filesystem API
  4. 4. 原理• Interacting with binary data and organizing that data into a meaningful hierarchy of folders.• Applications cannot access another domain/origin’s filesystem. ------ 《 Using the HTML5 Filesystem API 》
  5. 5. W3C FileSystem API 标准http://www.w3.org/TR/file-system-api/
  6. 6. FileSystem API 标准的构成• Data Persistence and accessing the API• Shared data types• The asynchronous filesystem interface• The synchronous filesystem interface• Errors and Exceptions
  7. 7. What can it do ?• Storage and Quota• Working with Files• Working with Directories• Copying, Renaming, and Moving Entries• ……
  8. 8. Tips1.window.webkitStorageInfo.requestQuota( PERSISTENT, 2*1024*1024, function(bytes) {}, function(e) {});2.%appdata %/baidu/browser/system/FileSystem3.Run on Server()
  9. 9. BDFileSystem API• Static Class• The asynchronous filesystem interface• common CRUD of file and directory
  10. 10. How to use• Src & APIs• Demo

×