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 7614510A79 for ; Thu, 17 Apr 2014 14:08:18 +0000 (UTC) Received: (qmail 27580 invoked by uid 500); 17 Apr 2014 14:08:17 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 27548 invoked by uid 500); 17 Apr 2014 14:08:17 -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 27540 invoked by uid 99); 17 Apr 2014 14:08:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Apr 2014 14:08:17 +0000 X-ASF-Spam-Status: No, hits=0.3 required=5.0 tests=FREEMAIL_REPLY,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of wjamesjong@gmail.com designates 209.85.160.181 as permitted sender) Received: from [209.85.160.181] (HELO mail-yk0-f181.google.com) (209.85.160.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Apr 2014 14:08:13 +0000 Received: by mail-yk0-f181.google.com with SMTP id 131so362956ykp.26 for ; Thu, 17 Apr 2014 07:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=yC4NLgjAry2Kpi+DAdq5m5gVuDjkoyEccSy/JLs89zY=; b=QIufEal3LHddxCfU53PFYUNhQm+QshIfyNFmBx5Vu3cmk+MwRe6++hsbPmwx30pFDk iHQgh01WsHA7mA7nGOL5Y1fSM6NKn4kvYk3FydWOjTZilgx3cppxfGCP07yYwmi06K8A YBylYQTjiHoMm2KValG4EqdaG8b29qL0Ku7Asp9iMaC9JNKx1zEcyp6s2eihPmoyAVKs 0Jy+OGWhCuoe03IURz0ux3pJ5vucqsbn+eIWIZpbLYh+3D+ASdb5Df9UJX4fVs3TBr5E JxRwyPAYtGQ/4qIFme1eLpj9dLQf4lgMoo3T0E6It0gwOVs+5v8t2dnwvXUgAWyAsgdY P5tQ== X-Received: by 10.236.220.72 with SMTP id n68mr22841566yhp.102.1397743670700; Thu, 17 Apr 2014 07:07:50 -0700 (PDT) Received: from jamess-mbp.raleigh.ibm.com (pokama-o.bluebird.ibm.com. [129.42.208.176]) by mx.google.com with ESMTPSA id g65sm48315203yhm.28.2014.04.17.07.07.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Apr 2014 07:07:49 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: should FileTransfer.download() auto mkdir target's path? From: James Jong In-Reply-To: Date: Thu, 17 Apr 2014 10:07:48 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <4BB0DC7B-B496-44D6-825F-28FFF41BE13C@gmail.com> References: <5892923C-448D-41F6-A8DA-FA660A7FF6F7@gmail.com> To: dev@cordova.apache.org X-Mailer: Apple Mail (2.1874) X-Virus-Checked: Checked by ClamAV on apache.org +1 for consistency -James Jong On Apr 17, 2014, at 8:36 AM, Ian Clelland = wrote: > +1 for consistency, and the simplest API. >=20 >=20 >=20 > On Thu, Apr 17, 2014 at 8:29 AM, Mike Billau = wrote: >=20 >>>=20 >>> We can choose to make file-transfer it's own (higher level) thing = with >> it's >>> own conventions, or we can aim for cohesiveness ... the original = design >> was >>> based on being cohesive, I think. >>>=20 >>=20 >> While I feel like being cohesive and in line with the File API is the >> better choice, it seems that since Android and iOS already implement = the >> mkdir functionality, FileTransfer is already its own thing. It seems = like >> it would be more of a headache to deprecate the mkdir feature on = Android >> and iOS than it would be to just say "FileTransfer is it's own higher = level >> thing" and bring WP8 into alignment. And who knows, maybe we will = want to >> add new functionality into FileTransfer in the future (although I = can't >> think of any examples.) If nobody has any issues I'll create the JIRA = issue >> for WP8. >>=20 >>=20 >>=20 >> On Wed, Apr 16, 2014 at 3:50 PM, Jesse = wrote: >>=20 >>> No, no spec, the issue was a File API issue, and the file-transfer = plugin >>> inherits some of the conventions. >>> We can choose to make file-transfer it's own (higher level) thing = with >> it's >>> own conventions, or we can aim for cohesiveness ... the original = design >> was >>> based on being cohesive, I think. >>>=20 >>>=20 >>> @purplecabbage >>> risingj.com >>>=20 >>>=20 >>> On Wed, Apr 16, 2014 at 12:42 PM, Ian Clelland = >>> wrote: >>>=20 >>>> There's a spec? I thought filetransfer was something that PhoneGap >>>> introduced. >>>>=20 >>>>=20 >>>> On Wed, Apr 16, 2014 at 3:32 PM, Jesse >> wrote: >>>>=20 >>>>> Originally WP8 was creating any missing intermediate folders, but >> this >>>> was >>>>> raised as a defect because the spec explicitly states it should >> produce >>>> an >>>>> error in this case. >>>>> Trying to dig up the issue ... >>>>>=20 >>>>>=20 >>>>> @purplecabbage >>>>> risingj.com >>>>>=20 >>>>>=20 >>>>> On Wed, Apr 16, 2014 at 12:07 PM, James Jong = >>>> wrote: >>>>>=20 >>>>>> I think iOS attempts to create the directory first. >>>>>>=20 >>>>>>=20 >>>>>=20 >>>>=20 >>>=20 >> = https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/ios= /CDVFileTransfer.m#L660 >>>>>> -James Jong >>>>>>=20 >>>>>> On Apr 16, 2014, at 2:58 PM, Shazron wrote: >>>>>>=20 >>>>>>> Additional info: >>>>>>> iOS will not create intermediate folders for download(), they >> must >>>>>> already >>>>>>> exist >>>>>>> (based on my tests with NSFileManager >>>>>> createFileAtPath:contents:attributes >>>>>>> call that is used by FileTransfer.download()) >>>>>>>=20 >>>>>>>=20 >>>>>>> On Wed, Apr 16, 2014 at 10:57 AM, Mike Billau < >>> mike.billau@gmail.com >>>>>=20 >>>>>> wrote: >>>>>>>=20 >>>>>>>> Hello, >>>>>>>>=20 >>>>>>>> When using FileTransfer.download(), if the target location >>> contains >>>>>> folders >>>>>>>> that do not exist on the device, should FileTransfer >>> auto-magically >>>>>> mkdir >>>>>>>> these folders to save the download? >>>>>>>>=20 >>>>>>>> If target=3D /foo/image.png, and if /foo/ doesn't exist, = Android >>> will >>>>>> create >>>>>>>> the /foo/ dir for you. WP8 doesn't seem to do this and will >>> instead >>>>>> return >>>>>>>> with an error. I don't know which implementation should be >>>> considered >>>>>>>> "correct." It seems like a "good" dev should first check that >> the >>>>> target >>>>>>>> exists and create it before saving the image, but I'm all for >>> making >>>>>> things >>>>>>>> easier for the developer and just doing it auto-magically (I >> hate >>>> that >>>>>>>> word...) >>>>>>>>=20 >>>>>>>> I'm using 3.1 btw, sigh and sorry! Thanks everyone for your >>>> opinions. >>>>>>>>=20 >>>>>>=20 >>>>>>=20 >>>>>=20 >>>>=20 >>>=20 >>=20