Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-5015

fileUtils is not defined error in BB10 file plugin

    XMLWordPrintableJSON

Details

    Description

      This was reported on the BB forums:

      Hello,

      I'm trying to use the org.apache.cordova.file plugin however there seems to be a problem with the includes. If you look in for example:

      C:\<myproject>\platforms\blackberry10\www\plugins\org.apache.cordova.file\www\blackberry10\File.js

      for this code block:

      /**

      • Returns a "slice" of the file.
      • Slices of slices are supported.
      • start {Number} The index at which to start the slice (inclusive).
        * end {Number}

        The index at which to end the slice (exclusive).
        */
        File.prototype.slice = function(start, end) {
        return fileUtils.createFile(this.nativeFile.slice(start, end));
        };

      fileUtils is not defined. Adding the below line like in FileWriter.js didn't work either:

      EDIT: actually the below line does work when you use a semi-colon instead of comma! But should still be fixed in the official release too.

      var fileUtils = require('./BB10Utils');

      Link to thread:

      http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Phonegap-3-0-File-plugin-fileUtils-not-defined/m-p/2618103#M40965

      Attachments

        Activity

          People

            bryanhiggins Bryan Higgins
            bryanhiggins Bryan Higgins
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: