new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Tauri · Plugins and security · all subjects

fs/setup

7 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

File System plugin setup with npm and cargo

To set up the File System plugin automatically using npm/yarn/pnpm/deno/bun, run the command: npm run tauri add fs (or yarn run tauri add fs, pnpm tauri add fs, deno task tauri add fs, bun tauri add fs). To manually set up, run 'cargo add tauri-plugin-fs' in the src-tauri folder, then modify lib.rs to add .plugin(tauri_plugin_fs::init()) to the tauri::Builder, then install the JavaScript bindings with npm install @tauri-apps/plugin-fs (or yarn add, pnpm add, deno add npm:@tauri-apps/plugin-fs, bun add).

File System plugin Rust initialization

In src-tauri/src/lib.rs, add the tauri_plugin_fs::init() plugin to the tauri::Builder: tauri::Builder::default().plugin(tauri_plugin_fs::init()).run(tauri::generate_context!()).expect("error while running tauri application");

Android File System permissions for external storage

To use audio, cache, documents, downloads, images, public, or video directories on Android, add these permissions to the manifest tag in gen/android/app/src/main/AndroidManifest.xml: <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> and <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

iOS File System privacy requirements with PrivacyInfo.xcprivacy

iOS requires PrivacyInfo.xcprivacy file in src-tauri/gen/apple folder with NSPrivacyAccessedAPICategoryFileTimestamp key and C617.1 approved reason code for file timestamp access. The reason code C617.1 applies when accessing file timestamps, sizes, or other metadata within app containers, app group containers, or CloudKit containers.

File System watch function requires feature flag

The watch() function requires the 'watch' feature flag in Cargo.toml: [dependencies] tauri-plugin-fs = { version = "2.0.0", features = ["watch"] }

File System plugin setup in JavaScript

To use @tauri-apps/plugin-fs: Add @tauri-apps/plugin-fs: ^2.0.0 to package.json. In Rust: plugin(tauri_plugin_fs::init()). In JavaScript: import { mkdir, BaseDirectory } from '@tauri-apps/plugin-fs'; await mkdir('db', { baseDir: BaseDirectory.AppLocalData });

File System plugin setup and API in Tauri 2.0

In Tauri 2.0, the File System plugin replaces the old fs API. Add 'tauri-plugin-fs = "2"' to Cargo.toml. In Rust, use std::fs functions. In JavaScript, import from '@tauri-apps/plugin-fs'. Example: import { createDir, BaseDirectory } from '@tauri-apps/plugin-fs'; await createDir('db', { dir: BaseDirectory.AppLocalData });

Give your agent this brain