Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is LFS_NAME_MAX 255 bytes a little larger? #49

Open
xjtuecho opened this issue Apr 13, 2018 · 3 comments
Open

Is LFS_NAME_MAX 255 bytes a little larger? #49

xjtuecho opened this issue Apr 13, 2018 · 3 comments

Comments

@xjtuecho
Copy link

Most files or directories do not have a so long name. If user define 'struct lfs_info' on the stack, it may be unsafe. I have reduced LFS_NAME_MAX to 32 and it works. But I don't want to modify ‘lfs.h’. Should this macro appear in ‘lfs_util.h’ ?

@geky
Copy link
Member

geky commented Apr 18, 2018

You're right! I've actually added an ifdef so you can redefine it to a good value is good for your system: #48

One concern is portability (ie mounting a storage device onto a PC), since different systems may support different name sizes. In #48 I added the file name size as an entry in the superblock at format time, so other systems should respect it.

That's the main reason it's not supported quite yet.

@xjtuecho
Copy link
Author

Can I mount LittleFS onto a PC with windows ?

@geky
Copy link
Member

geky commented Apr 29, 2018

No, not on windows at the moment. Though I hope put one together when I have the time (or I'd be excited if someone else put one together).

There is a fuse wrapper which allows you to mount LittleFS in linux. You could use a virtual machine, although it wouldn't be convenient:
https://github.com/geky/littlefs-fuse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants