Skip to content

[Bug]: Recursive rmdir returns error while trying to remove folder, that contains asar file. #40943

Closed as not planned

Description

@tangjfn

Preflight Checklist

Electron Version

28.1.2

What operating system are you using?

Windows

Operating System Version

Windows 11 22631.3007

What arch are you using?

x64

Last Known Working Electron version

27..

Expected Behavior

await fs.promises.rm("path contains asar file",{force: true, recursive: true})
// no throw

Actual Behavior

await fs.promises.rm("path contains asar file",{force: true, recursive: true})
// throw a error ENOTEMPTY: directory not empty, rmdir '...'

Testcase Gist URL

No response

Additional Information

No response

Activity

  1. added
    blocked/need-repro
    on Jan 10, 2024
  2. electron-issue-triage commented on Jan 10, 2024

    @electron-issue-triage

    Hello @tangjfn. Thanks for reporting this and helping to make Electron better!

    Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

    Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

    Now adding the blocked/need-repro Needs a test case to reproduce the bug label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

  3. MarshallOfSound commented on Jan 10, 2024

    @MarshallOfSound
    Member

    If you want to treat ASAR files as "files" instead of transparently treating them as filesystems, you have to use original-fs instead of fs.

    E.g. const fs = require('original-fs')

    That is an unmodified version of the fs module that doesn't include our patches for asar support

  4. tangjfn commented on Jan 11, 2024

    @tangjfn
    Author

    original-fs throw same error

  5. removed
    blocked/need-repro
    on Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions