cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabbage <purplecabb...@gmail.com>
Subject Re: CB-285 (FileSystem paths)
Date Tue, 13 May 2014 16:02:10 GMT
Yeah almost. Still brewing a little. 
Give me a couple hours. 



> On May 12, 2014, at 10:05 AM, Andrew Grieve <agrieve@chromium.org> wrote:
> 
> Now that email works again - Jesse, were you thinking of proposing a tweaks
> API, or something different altogether.
> New related bug here:
> 
> https://issues.apache.org/jira/browse/CB-6670
> 
> 
>> On Tue, May 6, 2014 at 6:21 PM, Brian LeRoux <b@brian.io> wrote:
>> 
>> That is a very good point! I say it is good enough for now. Something to
>> flag for our W3C friends to look at and consider in the spec.
>> 
>> 
>> On Tue, May 6, 2014 at 1:43 PM, Andrew Grieve <agrieve@chromium.org>
>> wrote:
>> 
>>> There are two types of config for file:
>>> 1. You can do is disable parts of the filesystem (doubt anyone would do
>>> this)
>>> 2. You can switch where PERSISTENT filesystem maps to (sane place vs
>> legacy
>>> place)
>>> 
>>> What's missing is a way to retrieve the paths that you might want. No
>>> configuration required for this part.
>>> 
>>> I'd like to avoid making the calls look like they are a part of the file
>>> spec, so that users won't be tempted to think that it would work in a
>>> non-Cordova environment.
>>> 
>>> 
>>>> On Tue, May 6, 2014 at 1:47 PM, Brian LeRoux <b@brian.io> wrote:
>>>> 
>>>> This plugin is helpful though I can't help but wonder if we can't
>>> shoehorn
>>>> into specs (or at least provide spec feedback).
>>>> 
>>>> Right now all config is done w/ config.xml instead of programmatic (?)
>>>> 
>>>> 
>>>> On Tue, May 6, 2014 at 7:06 AM, Andrew Grieve <agrieve@chromium.org>
>>>> wrote:
>>>> 
>>>>> Closer than ever to resolving this (woo!)
>>>>> 
>>>>> The file plugin is now able to read & write to roots on the
>> filesystem
>>>>> beyond PERSISTENT and TEMPORARY on iOS, Android, and BlackBerry (and
>>>> maybe
>>>>> others?)
>>>>> 
>>>>> However, you still can't query for the location of these places
>> (doh!)
>>>>> 
>>>>> There's a file-extras plugin in cordova-labs:
>> https://git-wip-us.apache.org/repos/asf?p=cordova-labs.git;a=blob;f=file-extras/fileextras.js;h=1f8f88f7222bd4022f2f802f6825c189b10445d9;hb=aaf61d4
>>>>> 
>>>>> That was used to experiment with an API for this. I think the API is
>>>> pretty
>>>>> much fine, and I'd like to add it to the core file plugin rather than
>>>> have
>>>>> it as a separate plugin.
>>>>> 
>>>>> This would add:
>>>>> cordova.plugins.file.getDirectoryForPurpose(purpose, options, win,
>>> fail)
>>>>> 
>>>>> Where purpose can be one of:
>>>>> var Purpose = {
>>>>>     'data': 0, // General application data (default)
>>>>>     'documents': 1, // Files that are meaningful to other
>> applciations
>>>>> (e.g. Office files)
>>>>>     'cache': 2, // Temporary files that should survive app restarts
>>>>>     'temp': 3, // Files that can should be deleted on app restarts
>>>>>     'app-bundle': 4 // The application bundle (iOS only)
>>>>> }
>>>>> 
>>>>> And also add convenience wrappers:
>>>>> cordova.plugins.file.getDataDirectory(syncable, win)
>>>>> cordova.plugins.file.getDocumentsDirectory(win)
>>>>> cordova.plugins.file.getTempDirectory(win)
>>>>> cordova.plugins.file.getCacheDirectory(win)
>>>>> 
>>>>> 
>>>>> Any comments on this?
>> 

Mime
View raw message