Can't overwrite or delete read-only files in work folder

Version: 1.7.27.0

Frequency: Consistently

Severity: High
(Low - quality of life, workflow optimization, rare enough to not impact production, etc…
High - critical but workarounds are available, important feature not working as expected, frequent enough to impact production
Blocker - prevents from working on the project, prevents from releasing the product)

Marketplace package name: if applicable

Context: Any time the WASM module tries to delete files / directories from the work folder that are set to read-only.

Similar MSFS 2020 issue: 2020 has the same issue.

Bug description:
Files in the work folder can sometimes be set to read-only by external programs like antivirus software. The WASM module can’t modify or delete files and directories that are set to read-only.

Tried with remove(), rmdir(), and fsIOOpen(FsIOOpenFlag_WRONLY, […]). None of them work.

The read-only can’t be removed with chmod since it’s not available in WASM.

Repro steps:

  1. Create a file in the work folder.
  2. In the file explorer, right-click on the file and open properties.
  3. In the attributes enable ‘read-only’ and apply.
  4. With WASM, try to delete or write to the file.

Attachments:

Private attachments: Send a PM to @PrivateContent with the link to this topic and the link to download your content

We don’t have any plan to allow chmod from WASM modules for now. This may change in the future but I am not 100% convinced the use case you present here will drive us there:

  • If an antivirus is locking files this should only be temporary so your module should implement a “retry” mechanism to handle such a case - note that this is something that can happen with a native EXE so the problem is not exactly related to WASM in this case.
  • I agree that files locked by external programs are a different issue but I would say that in this case the problem comes from these programs rather than from WASM. Do you know why these programs would lock files in the work folder?

In both cases, I don’t really see any bug in the current implementation but feel free to discuss if you don’t agree.

Best regards,

Eric / Asobo

This bug report has been marked as by design.

1 Like