Skip to content

Use stream in tauri-plugin-fs writeFile #1598

@rwv

Description

@rwv

Describe the problem

For now I’m using

const dataBuffer = await blob.arrayBuffer();
const data = new Uint8Array(dataBuffer);
await writeFile(filename, data)

to write file.

Describe the solution you'd like

Can we use blob.stream to get a readable stream and pass it to writeFile. Since v2’s IPC is based on Response, we can use new Response() to generate a streaming response to improve performance and reduce memory usage.

Alternatives considered

Can Transferable object improve performance?

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: fsIncludes former "fs-extra" and "fs-watch" pluginsquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions