Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E3199107DC for ; Tue, 5 Nov 2013 19:11:34 +0000 (UTC) Received: (qmail 26299 invoked by uid 500); 5 Nov 2013 19:11:34 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 26251 invoked by uid 500); 5 Nov 2013 19:11:34 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 26243 invoked by uid 99); 5 Nov 2013 19:11:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Nov 2013 19:11:34 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of iclelland@google.com designates 209.85.219.47 as permitted sender) Received: from [209.85.219.47] (HELO mail-oa0-f47.google.com) (209.85.219.47) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Nov 2013 19:11:30 +0000 Received: by mail-oa0-f47.google.com with SMTP id k1so1029309oag.6 for ; Tue, 05 Nov 2013 11:11:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=Z0v1M7q96cA1a4WeSEF+o30KsRZqH1qzhz/SSyxo2sY=; b=besp6X9qG/s76izBgt3QaMWl+mbHEHgp6GngCwk5D9XhoU56wTh/tWpTEUxPPLnFIu bxX+PGQByJrrbl1sufbCKF0oHK9SOsaXnqKeSFifk4m4MDg2vSwMjjbbmgmGzkwgyShn znUuryTDEOZw2K/X/UGi/Krd/gj2Nc/ODXKPerOpM0J3Mdi2//QSQ4tu8+I9KMyZP9Wr gslmcPegymEMR/xINyIOOtPkLT8Md3QAKjdhxHgo+aXZndhW6UQLEAUwmw2HCZXlI0ak 2+tjHrCMGdxkKkY7GzA3Mewo78TwfdvikhnJ3RjAU8ZVSKziHKu3jNM2MJairAi3ZoJH Zd3g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=Z0v1M7q96cA1a4WeSEF+o30KsRZqH1qzhz/SSyxo2sY=; b=VFaoACEPgnc1STDf3vaVZviCwrEdvAP4w83nXJ87cNueWC5SELnrwy+/Yghc8/xE+x lmzsFYFvKZumaO9ChokVm2HJDXInAJ+UuruajNT+vtwBQfgTUdgtt9Vh/8oO/eY5Fik1 /faHWQ7qlW+Zqf6Sjdvovydw6BRxZZopR2daI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:content-type; bh=Z0v1M7q96cA1a4WeSEF+o30KsRZqH1qzhz/SSyxo2sY=; b=AMIonKeDEItKBPOseFPUsjyvMUh9j1YqbMB/BBxNFlPVcVNXx8a+Re1TTkQFBPkrUA fbu16WD4bq6DlwTfASRtU2x+XKkaPw3Sz8oFNyYtwn5XfVT5khp0WvVH7ysVSNhfD1EY VZHVQNUmvjDPa1izIov8dx5aeLPd42OcqbapVNymN1ZRlMyl0y7yp0nPRrEuEBlltldJ PdnKMtqHFI2Q6V86Y0L8aL7YepoAqjGY/XAGgStFZZaV9eB7HgJMVfSeXMuXB736x7aQ +z74iB6Lf6DUqQkopLNBIgws5ZbGtl1UzTUrl0qore1VToPcX9v95MREu37RiJZKd4hK yXGg== X-Gm-Message-State: ALoCoQl7LioXj8BvEqfSeashhHec95StaMZo+7Uq+1Rc7QBBfHrImakXOj/gSo1BoFNTQ4jGIGM7mKqnhgnFIjL28ph9fY7bh7UxGnA/w23Nvu34HKj1MGHg6kKHIR5UZYuhBz7Rtd50SbwqoeYWFh8s+Qy4ZgZtlZG1k/hqCeS2DkHyu4CaKLjZJHWwcbq9erUFYdBG0nbCrAKqgHy4L3dvNsMro1jsLw== X-Received: by 10.60.141.225 with SMTP id rr1mr2024966oeb.55.1383678668690; Tue, 05 Nov 2013 11:11:08 -0800 (PST) MIME-Version: 1.0 Sender: iclelland@google.com Received: by 10.182.52.6 with HTTP; Tue, 5 Nov 2013 11:10:48 -0800 (PST) In-Reply-To: References: From: Ian Clelland Date: Tue, 5 Nov 2013 11:10:48 -0800 X-Google-Sender-Auth: TjnU7MDI2uR6EhDHEQU6yTtmx9U Message-ID: Subject: Re: New filesystem roots API? To: "dev@cordova.apache.org" Content-Type: multipart/alternative; boundary=047d7b472a4087eccc04ea72cbdf X-Virus-Checked: Checked by ClamAV on apache.org --047d7b472a4087eccc04ea72cbdf Content-Type: text/plain; charset=UTF-8 On Tue, Nov 5, 2013 at 9:32 AM, Brian LeRoux wrote: > I'm trying to understand: precisely what does this provide us that > requestFileSystem does not? (Currently.) > I think it currently provides two things, of dubious value: First, it's a synchronous API, so if you need to get a URL to store a document, you could just write: var docsURL = getDocumentsDirectory(); and you immediately have a file:/// url that you can use with any of the URL-based APIs (like FileTransfer) to save documents. Whether the synchronous API is valuable or not is up for debate :) At the least, it lets you set that up early in your application, without having to wrap the whole app in a callback, or go through hoops with asynchronously testing and setting global variables. Second, and probably more important right now, is that it's currently developed independently of requestFileSystem. Currently, we have getCacheDirectory, getDocumentsDirectory, getTempDirectory, and getDataDirectory, but there is no corresponding 'cache' or 'documents' file system. They just return paths like "/var/mobile/some-long-uuid/appname.app/Documents/" This has let us deal with the idiosyncrasies of the various platforms -- their media storage, document storage, etc -- without having to write all of the code to handle that through the File API. But I think that I'm going to be doing the bulk of that work anyway. I don't think this will be necessary after we're finished overhauling the FIle plugin; it will be much easier to just add new file system roots for each of these things. > Another thing to consider, we need to document the differences from the W3C > proposed standards and get that feedback back to the browser vendors. > Yep; if there is a legitimate case for these functions -- the sync api, or the URL-centric API (as opposed to the FileEntry-centric API), then we should definitely be letting the standards folks and the browser vendors know. Ian > > > On Tue, Nov 5, 2013 at 4:35 PM, Ian Clelland > wrote: > > > During our FIleSystem API brainstorming session, we visited the idea of > > having an API to obtain URLs to various file system roots with a > > synchronous call. I was a big fan at the time, but I'm no longer certain > > that it provides any advantages over window.requestFilesystem. > > > > (Most of this code currently lives in the File-extras plugin, but the > idea > > would be to promote this to the File plugin, I believe.) > > > > The API would consist of a set of JS functions, get*URL (currently > > get*Directory) -- getTemporaryURL, getMediaURL, getDocumentsURL, etc. > These > > would return a URL which could then be used directly as a root for the > > files stored in it, or passed to window.resolveLocalFilesystemURL to > > retrieve a DirectoryEntry object. > > > > On systems which support filesystem:// URLs, this would probably return > > things like filesystem://localhost/temporary/, > > filesystem://localhost/documents/, etc. > > > > On systems which cannot support custom URLs -- BB10, maybe Windows Phone? > > -- this could return usable URLs like local:///path/to/documents/, or > > file:///path/to/documents/ > > > > This API is essentially a counterpart to window.requestFileSystem, and I > > think that it could be implemented in an asynchronous fashion essentially > > like this: > > > > getDocumentsDirectory = function(callback) { > > window.requestFileSystem('documents', function(fs)) { > > callback(fs.root.toURL()); > > }); > > }); > > > > Questions: > > > > Is there a pressing need for a synchronous version of this, or is the > async > > version above enough? > > Do we believe that other situations will arise where fs.root.toURL will > > return a different value than the corresponding get*URL function? > > I think it is better to support new FS roots by adding new HTML > filesystems > > to window.requestFileSystem, rather than just defining new URLs which > > aren't accessable any other way. Am I right in this, or are there going > to > > be significant hurdles to adding new roots for things like 'media', > > 'documents', 'cache', etc? > > > --047d7b472a4087eccc04ea72cbdf--