Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2317B200B61 for ; Tue, 9 Aug 2016 14:29:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 21E05160AA5; Tue, 9 Aug 2016 12:29:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 66C26160AA4 for ; Tue, 9 Aug 2016 14:29:21 +0200 (CEST) Received: (qmail 10965 invoked by uid 500); 9 Aug 2016 12:29:20 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 10954 invoked by uid 99); 9 Aug 2016 12:29:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Aug 2016 12:29:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 720D32C02A4 for ; Tue, 9 Aug 2016 12:29:20 +0000 (UTC) Date: Tue, 9 Aug 2016 12:29:20 +0000 (UTC) From: "Vladimir Kotikov (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-11307) Can't create file with cordova.file.dataDirectory or cordova.file.cacheDirectory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 09 Aug 2016 12:29:22 -0000 [ https://issues.apache.org/jira/browse/CB-11307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15413443#comment-15413443 ] Vladimir Kotikov commented on CB-11307: --------------------------------------- [~daserge], should we close this as outdated/no repro? > Can't create file with cordova.file.dataDirectory or cordova.file.cacheDirectory > -------------------------------------------------------------------------------- > > Key: CB-11307 > URL: https://issues.apache.org/jira/browse/CB-11307 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin File > Environment: Visual studio 2015 with cordova, Android 4.4.2 > Reporter: decagon > Assignee: Sergey Shakhnazarov > Labels: triaged, wfc > > I'm trying to create and write to a file in cordova.file.dataDirectory > (file:///data/data//files/) or cordova.file.cacheDirectory. > But without success on android 4.4.2 . > The code fails on : > or using : > fs.root.getFile("myfile.txt", { create: true, exclusive: false }, function () {}, function () {}); > Example of code : > window.resolveLocalFileSystemURL(cordova.file.dataDirectory, > function (directoryEntry) { // success > directoryEntry.getFile('myfile.txt', { create: true }, > function (fileEntry) { //success > fileEntry.createWriter( > function (fileWriter) { // success > fileWriter.onwriteend = function () { > console.log("OK"); > }; > fileWriter.onerror = function (e) { > console.log("Not OK"); > }; > // If data object is not passed in, > // create a new Blob instead. > if (!data) { > data = new Blob([' '], { type: 'text/plain' }); > } > data = JSON.stringify(data); > var blob = new Blob([data], { type: 'text/plain' }); > fileWriter.write(blob); > }, > function (e) { // error > console.log(e); > } > ); > }, > function (e) { // error > console.log(e); > } > ); > }, > function (e) { // error > console.log(e); > } > ); > directoryEntry.getFile doesn't work. > However, it works on Android 6 -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org