BlazorWorker icon indicating copy to clipboard operation
BlazorWorker copied to clipboard

Worker filesystem access

Open BorisGerretzen opened this issue 1 year ago • 1 comments

When I create a directory with DirectoryInfo dirInfo = new("temp"); dirInfo.Create(); in the main thread, the folder does not appear when executing Directory.GetDirectories("/"); when it is run from the worker. When it is executed from the main thread the folder does appear. Is there a way around this?

BorisGerretzen avatar Jul 26 '22 15:07 BorisGerretzen

Hello, thank you for your question. What you need for this to work is a persistent file system. I can't find any info on this, other than that it used to work with indexeddb once (idbfs), and that they removed it to keep the runtime small: https://github.com/dotnet/runtime/issues/48562

As I understand it, the current implementation is in memory only, and blazerworker has two (or more) separate processes with no memory sharing.

Depends on what you are trying to achieve here, but maybe try implementing IFileProvider interface using indexeddb or some other persistent browser api.

Tewr avatar Aug 10 '22 21:08 Tewr