-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Timestamp SDFS does not work correctly with 2GB SD card. #6981
Comments
Thanks for the detailed report. It's funny, I can't even find new uSD cards under 4GB (but have used a 128MB one leftover from a Palm PDA for testing). The only difference between 2GB and larger cards would be the FAT, not the directory/LFN stuff, so I think that's immaterial here. The "System Volume Information" really is on the card, it's not making it up. Looks like the card was used on a Windows PC at one point. SDFS isn't making that up, so I don't see a problem there. The attribute should be HIDDEN,SYSTEM, but there's no concept of attributes in the Arduino fs page size is 0 because it doesn't really make any sense. There are no pages on a SD card, it has 512b accessible sectors. Are you suggesting it should be set to the block size (FAT allocation size)? File access time, I'll have to check. I don't think the SD would want to update it (wear out the flash on repeated reads causing multiple directory rewrites), but I'll take a look. |
Forgot to add a Dir->fileTime override, resulting in it always returning (time_t)0, or Jan 1, 1970. Add the override, returning the proper lastWriteTime. Fixes esp8266#6981
Well, pretty obvious. I forgot to provide the Dir->fileTime callback. I was even reading out the file time and caching it in the Dir structure...just never returning it. PR #6985 should fix this. |
Forgot to add a Dir->fileTime override, resulting in it always returning (time_t)0, or Jan 1, 1970. Add the override, returning the proper lastWriteTime. Fixes #6981
Basic Infos
Platform
Settings in IDE
Problem Description
Timestamp SDFS does not work correctly with 2GB SD card.
(I currently have no hardware available for larger SD cards)
dir.next also gives the "Volume information entry"
Timestamp not set:
dir.fileTime () returns 1970-01-01 00:00:00 always
file.getLastWrite () returns 2000-01-01 1:00:00 or correct time if set.
fsInfo.pageSize returns 0 (zero)
MCVE Sketch
Debug Messages
The text was updated successfully, but these errors were encountered: