pub fn write_json_to_file<T: Serialize>(data: &T) -> Result<(), Box<dyn Error>>Expand description
Atomically writes JSON data to file with file locking.
This function:
- Writes data to a temporary file in the same directory
- Atomically renames the temp file to the target file
This ensures file integrity even if the process is interrupted.