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

Windows 8: DirectoryReader returns isFile = true for directories

    XMLWordPrintableJSON

Details

    Description

      All entries returned by DirectoryReader.readEntries have isFile set to true.

      The expected result is that directories have isFile:false and isDirectory:true.

      Here is a code sample that will show the error:

            window.requestFileSystem(LocalFileSystem.PERSISTENT, 5 * 1024 * 1024 * 1024, function (fs) {
              //Ensure that there is one directory in the root
              fs.root.getDirectory('foo', { create: true }, function (newDir) {
                //Use reader to get the directory
                var reader = fs.root.createReader();
                reader.readEntries(function (results) {
                  for (var i = 0; i < results.length; i++) {
                    if (results[i].name != "foo")
                      continue;
      
                    // foo should be directory
                    if (results[i].isFile)
                      throw "'foo' is a directory and isFile is true";
                  }
                });
              });
            });
      

      Attachments

        Activity

          People

            purplecabbage Jesse MacFadyen
            matti-eerola Matti Eerola
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: