emilk / emilk/egui

eframe: expose means of writing files to the file-storage directory location

Open
#3,134 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

**Is your feature request related to a problem? Please describe.**
I am trying to store medium-sized binary files (not just serde) alongside the application state. I'd like to put them in the same directory where `FileStorage` is going to store other application state though.

**Describe the solution you'd like**
Option 1: Storage could expose a `get_path` API. This would be easier, though presents complications when running on web.

Option 2: Storage could expose an API like:
```
fn write_file(&mut self, key: &str, writer: FnOnce(impl std::io::Write));
fn read_file(&mut self, key: &str, reader: FnOnce(impl std::io::Read));
```
on web this probably needs to be backed by IndexedDB or OPFS.

Contributor guide

Open the contributing guide

Research direction

Start by locating the FileStorage implementation and reviewing how its native file-storage directory is selected. Compare the proposed get_path and write_file/read_file APIs, including the stated web constraints around IndexedDB or OPFS; done means a decided, cross-platform storage interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.