Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0F1999036 for ; Fri, 24 Feb 2012 21:34:30 +0000 (UTC) Received: (qmail 38865 invoked by uid 500); 24 Feb 2012 21:34:29 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 38842 invoked by uid 500); 24 Feb 2012 21:34:29 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 38834 invoked by uid 99); 24 Feb 2012 21:34:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2012 21:34:29 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gibson.becky@gmail.com designates 209.85.160.175 as permitted sender) Received: from [209.85.160.175] (HELO mail-gy0-f175.google.com) (209.85.160.175) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2012 21:34:23 +0000 Received: by ghbz2 with SMTP id z2so38591ghb.6 for ; Fri, 24 Feb 2012 13:34:03 -0800 (PST) Received-SPF: pass (google.com: domain of gibson.becky@gmail.com designates 10.101.6.38 as permitted sender) client-ip=10.101.6.38; Authentication-Results: mr.google.com; spf=pass (google.com: domain of gibson.becky@gmail.com designates 10.101.6.38 as permitted sender) smtp.mail=gibson.becky@gmail.com; dkim=pass header.i=gibson.becky@gmail.com Received: from mr.google.com ([10.101.6.38]) by 10.101.6.38 with SMTP id j38mr2455332ani.11.1330119242999 (num_hops = 1); Fri, 24 Feb 2012 13:34:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=10CzwhJjWCAecnN6H+lhanLK6gBk9015lVYiNRMcFgw=; b=NqgpmtTtEN7DLgTbJ18sWIFZGHulhdcp0e6UgJOXZXXteK8FLHR90bb1rbkLdQHSvK AwUDk0k4Ev7WPkne6LDIxYjADPRWD+KcgjTVyNj5IqZgweTrtUVb9dks1aIn/VmrlzXU ooY9YlOIbJ/oGZ5A5z1/Rw0LZnV4kw9gjonEQ= MIME-Version: 1.0 Received: by 10.101.6.38 with SMTP id j38mr1880146ani.11.1330119242908; Fri, 24 Feb 2012 13:34:02 -0800 (PST) Received: by 10.147.141.15 with HTTP; Fri, 24 Feb 2012 13:34:02 -0800 (PST) In-Reply-To: References: Date: Fri, 24 Feb 2012 16:34:02 -0500 Message-ID: Subject: Re: Bug in FileSystem.js From: Becky Gibson To: callback-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=001636c92564fb82b604b9bc84b7 X-Virus-Checked: Checked by ClamAV on apache.org --001636c92564fb82b604b9bc84b7 Content-Type: text/plain; charset=ISO-8859-1 Regading the FileSystem.name entry. The W3C spec is somewhat ambiguous on this so we implemented "persistent" and "temporary" when we did the original BB, iOS and Android implementations. I would prefer we debate changing that later. Regarding the DirectoryEntry name parameter, the spec indicates that is just the name of the directory, excluding the path leading to it. This is how BB, iOS and Android initially implemented this. We can solve the DirectoryEntry creation but with the following two changes: 1) modify the FileSystem constructor in FileSystem.js to the following: var FileSystem = function(name, root) { this.name = name || null; if (root) { this.root = new DirectoryEntry(root.name, root.fullPath); } }; 2) In the device code when returning from requestFileSystem the device code should return a pseudo FileSystem object: .name is the name of the file system (currently "persistent" or "temporary") and .root is a DirectoryEntry pseudo object (it has allof the paramters but there are no functions defined which is why we have to go through the full object creation). This is what BB, iOS and Android originally did, but I believe BB and Android had changed this to return the fullPath in the .root parameter. Making this change gets me further in the iOS update. However, I don't understand why the other platforms are returning a URL in the fullPath parameter. Will start/continue a thread on that. -becky -becky On Fri, Feb 24, 2012 at 3:21 PM, Simon MacDonald wrote: > So then the root directory of the persistent filesystem should look like: > > { name: "", fullPath: "/data/data/com.phonegap" } > > then if I create a cache directory off the root it would be: > > { name: "cache", fullPath: "/data/data/com.phonegap/cache" } > > but what do we do about someone who goes back two directories? You would > end up at: > > { name: "data", fullPath: "/data" } > > Do we need to prevent that type of behaviour? > > Simon Mac Donald > http://hi.im/simonmacdonald > > > On Fri, Feb 24, 2012 at 2:33 PM, Joe Bowser wrote: > > > No, I think you are partially right. I think the name should be blank > for > > the root directory of the persistent storage. It definitely shouldn't > say > > that it's persistent, that seems to be very wrong. > > > > Joe > > > > On Fri, Feb 24, 2012 at 11:10 AM, Simon MacDonald < > > simon.macdonald@gmail.com > > > wrote: > > > > > Becky has found a bug in FileSystem.js and I just wanted to bring it up > > > on the list before making any changes. At this line: > > > > > > > > > > > > https://github.com/apache/incubator-cordova-js/blob/master/lib/plugin/FileSystem.js#L13 > > > > > > you see a new DirectoryEntry is created using the *name* of the > > filesystem > > > and the *root* path of the filesystem. What is being passed in is > > something > > > like this: > > > > > > name = PERSISTENT > > > root = /data/data/com.phonegap > > > > > > so when the DirectoryEntry is created it will have a name of > > > *PERSISTENT*which is wrong. The name property should be the name of > > > the file or > > > *com.phonegap* in my example. > > > > > > Does this makes sense to everyone or are we going crazy? > > > > > > Simon Mac Donald > > > http://hi.im/simonmacdonald > > > > > > --001636c92564fb82b604b9bc84b7--