Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11817] Rework FileSystem API

GitHub Issuen/a
TypeStory
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsTiAPI
Labelsrock_solid, ti.next
ReporterIngo Muschenetz
AssigneeChris Barber
Created2012-11-19T04:05:07.000+0000
Updated2018-11-16T15:28:26.000+0000

Description

We need to rework the FileSystem API, perhaps as a module The biggest problem with the FileSystem API is parity. You can't even tell if something is a file or a directory on iOS. As far as Mobile Web is concerned, the FileSystem architecture supports multiple backends. The one and only backend today is local storage. I'd like to add a IndexedDB backed storage system, but IndexedDB is completely async, so it's not compatible with the Titanium FileSystem API. We should make it like node.js. This means Ti.FileSystem goes bye bye. You would require('fs') to get the FileSystem API. We should expose methods that are async friendly. Doing it this way allows us to:

ship both the existing FileSystem API and the new one

pave the way for ripping modules out of the Titanium namespace

introduce async versions of filesystem functions

mimic node.js's FileSystem API

On Mobile Web, it will be tricky/impossible to have a hybrid filesystem layer where local storage is used for synchronous api calls and IndexedDB is used for async calls. If the backend is IndexedDB, we could just have all sync functions fail in combination with the code processor detecting sync filesystem calls being made when IndexedDB is the backend.

Comments

No comments

JSON Source