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 199E3DA7F for ; Thu, 7 Mar 2013 02:41:07 +0000 (UTC) Received: (qmail 31534 invoked by uid 500); 7 Mar 2013 02:41:06 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 31291 invoked by uid 500); 7 Mar 2013 02:41:05 -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 31258 invoked by uid 99); 7 Mar 2013 02:41:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Mar 2013 02:41:04 +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 (nike.apache.org: domain of lorin.beer.dev@gmail.com designates 209.85.223.172 as permitted sender) Received: from [209.85.223.172] (HELO mail-ie0-f172.google.com) (209.85.223.172) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Mar 2013 02:40:59 +0000 Received: by mail-ie0-f172.google.com with SMTP id c10so10576432ieb.31 for ; Wed, 06 Mar 2013 18:40:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=+xuNjAv1rBXeywuHjw7XCyUuZAWUcwDpKVkmBSCLuZI=; b=tz4EZJAJMYmsEiSZ8dIrGjjvqm7z/Ofh4sJclJztOHNFXYZoSQN244mJbYAFgBffJq eiG0lR8zkp3B8SDH/a9I963zvBF7Nz7nJ67zlBzW2PFi4OhgvjvP50lmHYI2wsk5RZQN sNINnGJEsVn2eVrzt8++4VTZhDiajnQGXFMypdlAwCKqkcbpbd4Qr1ieh6NxHE7RjztG HUrFo3a3/33GHykVcUTrBy9As66i/GTC0R32x6/6mzqCJ/acDoLasx6Ts/VkEFJh9B8I g29NqG/JHzhE8rg/sjDOrV+3iipjS9XbsI20s/GmCgzluDtdADjix/W6/GxFfjE6ROmT 5VlA== MIME-Version: 1.0 X-Received: by 10.50.186.165 with SMTP id fl5mr12707376igc.81.1362624038281; Wed, 06 Mar 2013 18:40:38 -0800 (PST) Received: by 10.64.8.167 with HTTP; Wed, 6 Mar 2013 18:40:37 -0800 (PST) In-Reply-To: References: Date: Wed, 6 Mar 2013 18:40:37 -0800 Message-ID: Subject: Re: Writing binary data to disk From: Lorin Beer To: dev@cordova.apache.org Content-Type: multipart/alternative; boundary=14dae93411b9c3aa9904d74ca131 X-Virus-Checked: Checked by ClamAV on apache.org --14dae93411b9c3aa9904d74ca131 Content-Type: text/plain; charset=ISO-8859-1 Andrew: the Cordova docs on FileWriter state that the data sent is written as a UTF-8 string http://docs.phonegap.com/en/2.5.0/cordova_file_file.md.html#FileWriter The user doesn't want to specify a hex or binary encoded string, and have that written as binary data on the native side. As it sits now, providing a hex string would write a unicode string of hex characters. In order to to have a hex or binary string actually be written as binary, we'd need to: 1. pass an argument which explicitly sets the write mode, either to FileWriter constructor or FileWriter.write 2. set a state on FileWriter stating that the data string it receives is to be written in binary mode neither of these two options is explicitly part of the W3C spec on FileWriter On Wed, Mar 6, 2013 at 5:47 PM, Michal Mocny wrote: > We've added a way to send binary data across the android and ios bridge > (ArrayBuffers are a supported argument/message type). > > If you wanted to write a simple plugin to support writing binary data to > disk, it should be quite easy. > > Note: There are various limitations to the current way we send > ArrayBuffers, such as being limited to very small sizes per call. We are > soon going to be working on improvements here, expect JIRA issues and tests > to come soon. > > -Michal > > > On Wed, Mar 6, 2013 at 7:02 PM, Lorin Beer > wrote: > > > Hey folks, > > > > I was going through the unassigned jira issues, and came across > > CB-2406 > > ((https://issues.apache.org/jira/browse/CB-2406), which requests a > method > > to write binary data to disk. Before commenting to the user on the > issue, I > > thought I'd get some feedback from you guys. > > > > My feeling is that while there might be a use case or two, specifying a > > binary write mode doesn't fit in with the W3C FileWriter > > api, > > and shouldn't be a change to the File API of cordova. As such, the issue > > should probably be closed. > > > > The way in which the user would/should accomplish this kind of > > functionality would be to create a very simple plugin which takes a hex > > string and uses the native file writer api to open in binary mode. > > > > Before commenting to the user on the issue, I thought I'd get some > feedback > > from you guys. > > > > > > - Lorin > > > --14dae93411b9c3aa9904d74ca131--