Skip to content

Commit e4757ac

Browse files
add: add notes in the file-system plugin regarding Rust/JS API differences (#3184)
Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>
1 parent 8259c26 commit e4757ac

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/content/docs/plugin/file-system.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ import PluginPermissions from '@components/PluginPermissions.astro';
1616

1717
Access the file system.
1818

19+
:::note[Use std::fs or tokio::fs on the Rust side]
20+
If you want to manipulate files/directories through Rust, use traditional Rust's libs (std::fs, tokio::fs, etc).
21+
22+
:::
23+
1924
## Supported Platforms
2025

2126
<Compatibility plugin={frontmatter.plugin} />
@@ -120,6 +125,14 @@ with the required [NSPrivacyAccessedAPICategoryFileTimestamp] key and the [C617.
120125
## Usage
121126

122127
The fs plugin is available in both JavaScript and Rust.
128+
:::caution[Different APIs]
129+
Although this plugin has a file manipulation API on the frontend, in the backend it offers only the methods to change permission of some
130+
resources (files, directories, etc).
131+
132+
In the Rust side you can use the traditional file manipulation libraries,
133+
[std::fs](https://doc.rust-lang.org/std/fs/struct.File.html), [tokio::fs](https://docs.rs/tokio/latest/tokio/fs/index.html) or others.
134+
135+
:::
123136

124137
<Tabs syncKey="lang">
125138
<TabItem label="JavaScript" >

0 commit comments

Comments
 (0)