Skip to main content

write

Function write 

Source
pub fn write(code: &Path, harness: HarnessKind) -> Result<bool, Unguided>
Expand description

Brings QCode’s section of harness’s instruction file in the workspace folder code up to date, and says whether anything was written.

The new text is written beside the file and moved over it, with the old file’s permissions, so an agent reading at that moment finds the old file or the new one and never half of one. Runs on the disk, so it belongs on a background thread.

§Errors

Unguided when the file cannot be read or written, or its section cannot be found.