Skip to content

FileUtils

Category: Storage

Source: file_utils.dart

Functions

void atomicWrite(File file, String content)

Atomically replaces [file]'s contents: writes a sibling .tmp (flushed to disk so a crash can't leave a torn file), then renames it over [file].

On non-Windows the temp file is restricted to owner (0600) before the rename, so the final file is never briefly world-readable (mirrors the atomic-write-then-chmod pattern in credential_store). L3 / M12.

Released under the MIT License.