Skip to main content

write_chart_to_disk

Function write_chart_to_disk 

Source
pub fn write_chart_to_disk(
    path: &Path,
    bytes: &[u8],
    overwrite: bool,
) -> Result<u64, McpError>
Expand description

Write chart bytes to path, creating the parent directory if needed and honoring the overwrite flag.

Errors:

  • PermissionDenied if path exists and overwrite=false (matches export’s pre-flight check).
  • InternalError wrapping the underlying std::io::Error for mkdir or write failures.

Returns the number of bytes written.

§Errors