Skip to content

File Not Found when extracting file with directory separator '/' from an ASAR package generated on Windows #369

@hydrozoan

Description

@hydrozoan

I have an ASAR package that was generated on Windows using '' directory separators. The file is located within the package at 'test\test1.json'. When I call asar.extractFile using the filepath as 'test/test1.json' the method throws a File Not Found exception. Some of the documentation I found states that using '/' is the proper way to reference the file within the archive.

I was expecting to be able to call asar.extractFile with a path using '/' on both Windows and Linux and have the library locate the file whether the archive was generated on Windows or Linux.

Is this a bug or would I need to detect the OS in use when generating the package and adjust my path to use the correct directory separator?

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