@@ -203,7 +203,7 @@ Creates a file and returns a handle to it. If the file already exists, it is tru
203
203
204
204
``` js
205
205
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 });
207
207
await file .write (new TextEncoder ().encode (' Hello world' ));
208
208
await file .close ();
209
209
```
@@ -254,7 +254,7 @@ Always call `file.close()` when you are done manipulating the file.
254
254
import { open , BaseDirectory } from ' @tauri-apps/plugin-fs' ;
255
255
const file = await open (' foo/bar.txt' , {
256
256
read: true ,
257
- baseDir: BaseDirectory .App ,
257
+ baseDir: BaseDirectory .AppData ,
258
258
});
259
259
const buf = new Uint8Array ();
260
260
await file .read (buf);
@@ -268,7 +268,7 @@ Always call `file.close()` when you are done manipulating the file.
268
268
import { open , BaseDirectory } from ' @tauri-apps/plugin-fs' ;
269
269
const file = await open (' foo/bar.txt' , {
270
270
write: true ,
271
- baseDir: BaseDirectory .App ,
271
+ baseDir: BaseDirectory .AppData ,
272
272
});
273
273
await file .write (new TextEncoder ().encode (' Hello world' ));
274
274
await file .close ();
@@ -283,7 +283,7 @@ Always call `file.close()` when you are done manipulating the file.
283
283
import { open , BaseDirectory } from ' @tauri-apps/plugin-fs' ;
284
284
const file = await open (' foo/bar.txt' , {
285
285
append: true ,
286
- baseDir: BaseDirectory .App ,
286
+ baseDir: BaseDirectory .AppData ,
287
287
});
288
288
await file .write (new TextEncoder ().encode (' world' ));
289
289
await file .close ();
@@ -300,7 +300,7 @@ Always call `file.close()` when you are done manipulating the file.
300
300
const file = await open (' foo/bar.txt' , {
301
301
write: true ,
302
302
truncate: true ,
303
- baseDir: BaseDirectory .App ,
303
+ baseDir: BaseDirectory .AppData ,
304
304
});
305
305
await file .write (new TextEncoder ().encode (' world' ));
306
306
await file .close ();
@@ -320,7 +320,7 @@ Always call `file.close()` when you are done manipulating the file.
320
320
const file = await open (' foo/bar.txt' , {
321
321
write: true ,
322
322
create: true ,
323
- baseDir: BaseDirectory .App ,
323
+ baseDir: BaseDirectory .AppData ,
324
324
});
325
325
await file .write (new TextEncoder ().encode (' world' ));
326
326
await file .close ();
@@ -339,7 +339,7 @@ Always call `file.close()` when you are done manipulating the file.
339
339
const file = await open (' foo/bar.txt' , {
340
340
write: true ,
341
341
createNew: true ,
342
- baseDir: BaseDirectory .App ,
342
+ baseDir: BaseDirectory .AppData ,
343
343
});
344
344
await file .write (new TextEncoder ().encode (' world' ));
345
345
await file .close ();
0 commit comments