All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
v0.5.0 - 2024-10-25
This release contains many small changes to the public API. It also introduces the
littlefs2-core
crate that can be used for crates that want to access littlefs2
filesystems without depending on a specific implementation version.
- Added object-safe traits
DynFile
,DynFilesystem
andDynStorage
for accessingStorage
,Filesystem
andFile
implementations for any storage. - Added
Filesystem::mount_or_else
function (#57) - Marked
Path::is_empty
,Path::from_bytes_with_nul
,Path::from_cstr
,Path::from_cstr_unchecked
,Path::as_str_ref_with_trailing_nul
,Path::as_str
, andPathBuf::new
asconst
. - Made
fs::FileOpenFlags
public and addedFrom<fs::FileOpenFlags>
forfs::OpenOptions
. - Support platforms where
c_int
is noti32
.
- Fixed macro hygiene for
path!
. - Fixed build error that would occur on Windows systems.
- Fixed compilation without default features.
- Added path iteration utilities (#47)
- Enforced const evaluation for
path!
. - Removed
cstr_core
andcty
dependencies. - Updated
littlefs2-sys
dependency to 0.2.0. - Replace all panicking
Path
/PathBuf
conversions with fallible alternatives:- Return a
Result
fromPath::from_str_with_nul
. - Replace the
From<_>
implementations forPath
andPathBuf
withTryFrom<_>
, except forFrom<&Path> for PathBuf
.
- Return a
- Refactor error types:
- Change
Error
enum to a struct with associated constants. - Remove
Error::Success
and enforce negative values forError
.
- Change
- Replace
Path::exists
withFilesystem::exists
- Replace
DynFilesystem::open_file_with_options_and_then{,unit}
withDynFilesystem::open_file_with_flags_and_then{,unit}
usingFileOpenFlags
instead ofOpenOptionsCallback
- Refactor attributes API:
- Change the
set_attribute
function inDynFilesystem
andFilesystem
to accept an ID and a slice instead of anAttribute
. - Add a buffer argument to the
attribute
function inDynFilesystem
andFilesystem
and return a slice of that buffer containing the read data. - Change the
Attribute
struct to store a slice with the read data and the total size of the attribute on the filesystem.
- Change the
- Introduce
object_safe::Vec
trait and changeDynFile::read_to_end
,DynFilesystem::read
andDynFilesstem::read_chunk
to be generic over aVec
implementation to support multipleheapless
versions (disabled by default).
- Removed
Path::from_bytes_with_nul_unchecked
. UseCStr::from_bytes_with_nul_unchecked
andPath::from_cstr_unchecked
instead. - Removed
From<littlefs2::path::Error> for littlefs2::io::Error
. - Removed
object_safe::OpenOptionsCallback
. - Removed
consts::ATTRBYTES_MAX_TYPE
. - Removed
dir-entry-path
feature (now always enabled).
This release fixes an overflow of the lookahead buffer. Users are advised to upgrade from previous releases to avoid filesystem corruption.
- Added
Path::from_str_with_nul
andpath!
to createPath
instances fromstr
. - Added
Eq
andPartialEq
implementations forPath
.
- Made
Path::from_bytes_with_nul_unchecked
const
. - [breaking] Replaced
LOOKAHEADWORDS_SIZE
(measured in multiples of four bytes) withLOOKAHEAD_SIZE
(measured in multiples of eight bytes) indriver::Storage
so that all possible values are valid. (See the lookahead size fix below for context.) - [breaking] Require
&mut self
indriver::Storage::read
for compatibility withembedded_storage
.
- Fixed the lookahead size reported to
littlefs2-sys
. Previously, the reported size was too large by the factor of 8, potentially leading to a buffer overflow causing filesystem corruption. Fixing this means thatStorage::LOOKAHEADWORD_SIZE
values that are not a multiple of 2 can now lead to an error. Fixes #16. - Propagate errors in littlefs callbacks instead of panicking.
- Added the
c-stubs
feature for improvedno-std
compatiblity.
- Removed the
PATH_MAX_PLUS_ONE
type from thedriver::Storage
trait.
Yanked.
- Removed the
FILEBYTES_MAX
,ATTRBYTES_MAX
andFILENAME_MAX_PLUS_ONE
types from thedriver::Storage
trait as they determined by the backend. - Updated to use resolver v2 to fix a dependency issue.
- Added
remove_dir_all_when
, allowing to filter "rm -rf "
- PathBuf::from errors on embedded nuls, and prevents ending with nuls
- get rid of ufmt (oversight in 0.2 release)
- get rid of dead code (oversight in 0.2 release)
- [breaking-change] The version of the
generic-array
dependency has been bumped to v0.14.2 (now thatheapless
v0.6.0` is out).
std
-triggering regression