Skip to content

Commit 9c028e7

Browse files
Adding in the file-system plugins osme notes highlighting that we don't have the same API on the Rust side, and that in Rust std::fs/tokio::fs should be used instead (with examples).
1 parent 10ecb0b commit 9c028e7

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)