Skip to main content

Module write

Module write 

Source
Expand description

Overwrites one or more files completely.

Verifies write-scope permissions using an FsMetadata structure that describes:

  • The project root directory.
  • Paths explicitly granted write permission.
  • Paths explicitly denied write permission.

If no paths are explicitly blocked, any file within the root directory is considered writable by default.

§Errors

Returns Err if the FsMetadata has inconsistent allowlist/blocklist entries. Individual file write failures are reported inline in the returned string rather than aborting the batch.

Content normalization is shared with read (LF + no BOM) and auto-generated files are refused via assert_editable_file.

Structs§

WriteResult

Functions§

write
Write content to one or more files.