Skip to content

StorageFile.openAsync returns undefined fileStream, but no error #64

Description

@logidelic

I'm just getting started with NodeRT & Electron (Windows 10). Some of the basics seem to be working, but I've quickly run up against a strange issue. Here's the code:

const {FileAccessMode, StorageFile} = require('electron').remote.require('@nodert-win10/windows.storage')

var fname = require('electron').remote.app.getPath('userData') + '\\test.jpg';

StorageFile.getFileFromPathAsync(fname, (err, storageFile) => {
    if (err) return console.log(err);

    storageFile.openAsync(FileAccessMode.read, (err, fileStream) => {
        if (err) return console.log(err);

        // fileStream is NULL HERE!
    })
})

getFileFromPathAsync succeeds and the resulting storageFile is valid. However, openAsync returns an undefined fileStream and an undefined err!

Questions:

  • What am I doing wrong here?
  • In any case, why is openAsync failing silently with no error?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions