Open paulyoung opened 2 years ago
fatfs recommends using fscommon::BufStream
fatfs
fscommon::BufStream
Note: it is recommended to wrap the underlying file struct in a buffering/caching object like BufStream from fscommon crate. For example: let buf_stream = BufStream::new(img_file); let fs = fatfs::FileSystem::new(buf_stream, fatfs::FsOptions::new())?;
Note: it is recommended to wrap the underlying file struct in a buffering/caching object like BufStream from fscommon crate. For example:
BufStream
fscommon
let buf_stream = BufStream::new(img_file); let fs = fatfs::FileSystem::new(buf_stream, fatfs::FsOptions::new())?;
https://github.com/dfinity/cdk-rs/pull/245 and https://github.com/dfinity/cdk-rs/pull/247 appear to be doing something similar that won’t work out of the box here.
See also: BufRead, BufReader, and BufWriter: https://github.com/rust-lang/rust/blob/3d237ab52920924694f6fc3e47ee8588514bfa70/library/std/src/io/mod.rs#L38-L120
BufRead
BufReader
BufWriter
fatfs
recommends usingfscommon::BufStream
https://github.com/dfinity/cdk-rs/pull/245 and https://github.com/dfinity/cdk-rs/pull/247 appear to be doing something similar that won’t work out of the box here.