Skip to content

Commit 4248b62

Browse files
authored
fix(file-system): change BaseDirectory.App to BaseDirectory.AppData (#3108)
1 parent f59d548 commit 4248b62

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Creates a file and returns a handle to it. If the file already exists, it is tru
203203

204204
```js
205205
import { create, BaseDirectory } from '@tauri-apps/plugin-fs';
206-
const file = await create('foo/bar.txt', { baseDir: BaseDirectory.App });
206+
const file = await create('foo/bar.txt', { baseDir: BaseDirectory.AppData });
207207
await file.write(new TextEncoder().encode('Hello world'));
208208
await file.close();
209209
```
@@ -254,7 +254,7 @@ Always call `file.close()` when you are done manipulating the file.
254254
import { open, BaseDirectory } from '@tauri-apps/plugin-fs';
255255
const file = await open('foo/bar.txt', {
256256
read: true,
257-
baseDir: BaseDirectory.App,
257+
baseDir: BaseDirectory.AppData,
258258
});
259259
const buf = new Uint8Array();
260260
await file.read(buf);
@@ -268,7 +268,7 @@ Always call `file.close()` when you are done manipulating the file.
268268
import { open, BaseDirectory } from '@tauri-apps/plugin-fs';
269269
const file = await open('foo/bar.txt', {
270270
write: true,
271-
baseDir: BaseDirectory.App,
271+
baseDir: BaseDirectory.AppData,
272272
});
273273
await file.write(new TextEncoder().encode('Hello world'));
274274
await file.close();
@@ -283,7 +283,7 @@ Always call `file.close()` when you are done manipulating the file.
283283
import { open, BaseDirectory } from '@tauri-apps/plugin-fs';
284284
const file = await open('foo/bar.txt', {
285285
append: true,
286-
baseDir: BaseDirectory.App,
286+
baseDir: BaseDirectory.AppData,
287287
});
288288
await file.write(new TextEncoder().encode('world'));
289289
await file.close();
@@ -300,7 +300,7 @@ Always call `file.close()` when you are done manipulating the file.
300300
const file = await open('foo/bar.txt', {
301301
write: true,
302302
truncate: true,
303-
baseDir: BaseDirectory.App,
303+
baseDir: BaseDirectory.AppData,
304304
});
305305
await file.write(new TextEncoder().encode('world'));
306306
await file.close();
@@ -320,7 +320,7 @@ Always call `file.close()` when you are done manipulating the file.
320320
const file = await open('foo/bar.txt', {
321321
write: true,
322322
create: true,
323-
baseDir: BaseDirectory.App,
323+
baseDir: BaseDirectory.AppData,
324324
});
325325
await file.write(new TextEncoder().encode('world'));
326326
await file.close();
@@ -339,7 +339,7 @@ Always call `file.close()` when you are done manipulating the file.
339339
const file = await open('foo/bar.txt', {
340340
write: true,
341341
createNew: true,
342-
baseDir: BaseDirectory.App,
342+
baseDir: BaseDirectory.AppData,
343343
});
344344
await file.write(new TextEncoder().encode('world'));
345345
await file.close();

0 commit comments

Comments
 (0)