Skip to content

createFileStructure does not pass file/folder intent to fsOperation.extend stat #1745

Closed

Description

@Jobians

async createFileStructure(uri, pathString, isFile = true) {

Problem:
helpers.createFileStructure() passes isFile only at the top-level call. Inside its loop, it calls:

if (!(await fsOperation(newPath).exists())) { ... }
  • exists() is called on newPath
  • createFile() / createDirectory() is called on the parent path (currentUri)
  • stat() inside fsOperation.extend() cannot know whether the path is intended to be a file or folder.

Impact:

  • Files inside folders are treated as directories.
  • Creating folders in the root may fail.
  • Virtual paths cannot be correctly typed (isFile / isDirectory) before creation.

Root cause:
isFile is never passed to fsOperation(newPath).exists() or stat().

Proposed solution:

  • Expose the isFile intent to fsOperation.extend() / stat() calls inside the loop.
  • Or provide a context/hook so FS extensions can detect the user’s intent.

Notes:

  • Affects virtual file systems (paths not tied to a real filesystem).
  • Current workarounds require storing isFile externally, which is complex.

Activity

  1. self-assigned this
    on Dec 15, 2025
  2. github-actions commented on Feb 14, 2026

    @github-actions

    Hi there! 👋
    We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Acode, please let us know by commenting on this issue(i.e Bump!), and we will keep it open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, we'll close it in 14 days.
    Thanks for your help!

  3. Jobians commented on Feb 14, 2026

    @Jobians
    ContributorAuthor

    Bump!

  4. added a commit that references this issue on Mar 9, 2026
    65aa1b2
  5. moved this from Backlog to In progress in The Code Board - Acodeon Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions