trussed-dev / littlefs2

Idiomatic Rust API for littlefs

Home Page:https://lib.rs/littlefs2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Filename/Path maxima

nickray opened this issue · comments

The path::{Filename,Path} objects are not very well-developed yet. I am aware of the following issues:

  • It would be nice to use heapless::Vec for paths, and handle back and forth with C strings in littlefs-sys ergonomically
  • Our Path is more like std::path::PathBuf, we want to "follow std::path as much as appropriate"
  • Upstream has no notion (I believe) of maximum path, whereas we should
  • Upstream uses LFS_NAME_MAX in lfs_info_t (https://github.com/ARMmbed/littlefs/blob/master/lfs.h#L257), which we can only override via littlefs2-sys features. If we don't, then FILENAME_MAX_PLUS_ONE should be removed (set to its default of 256)
  • From the path machinery (ancestors etc.), at least join (or try_join) needs a clean implementation, need to decide how to handle length overflows (maybe just truncate?)