-
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
Compile error on FS.h: missing time.h import #6714
Comments
* Add time to filesystem API Support the ESP32 File::getLastWrite() call and setting the time on all filesystems automatically (assuming the system clock has been set properly and time(NULL) returns the proper time!). Adds Dir::fileTime() to get the time of a file being listed, similar to Dir::fileName() and Dir::fileSize(). Adds ::setTimeCallback(time_t (*cb)()) to File, Dir, and FS, allowing users to override the default timestamp on a per-file, directory, or filesystem basis. By default, a simple callback returning time(nullptr) is implemented. LittleFS uses the 't' attribute and should be backwards compatible. SD/SDFS work and include wrappers for obsolete SdFat timestamp callbacks using the MSDOS time. This PR does not update SPIFFS, due to compatability concerns and a possible massive rewrite which would make it possible to determine if an old-style ot metadata enabled FS is present at mount time. Includes an updated SD/listfiles and LittleFS_time example. Replaces #6315 * Add links to new mklittlefs w/timestamp support Include the update mklittlefs which generated 't' metadata on imported files. ../tools/sdk/lwip2/include/netif/lowpan6_opts.h * Add explicit note about timestamp being local time * Address review concerns Clean up some awkward object instantiations. Remove the _enableTime flag/setter from SPIFFS. Clean up the FSConfig constructors using C++ style init lists.
From what I can see,
I think this is an issue with the character |
Found the issue: Time.h from Arduino Time Library conflicts on case-insensitive filesystems. See also: Closing this issue as it's a problem with the library. |
Thanks for the links. |
@d-a-v good one, that works as well. So adding |
Are you willing to make a PR with this ? edit
|
I don't understand the core issue here, or how the suggested fix addresses it. |
I made one for FS.h only: #6730 |
Arduino Time Library (a popular library that offers some time-related functions) ships a header file called |
That comment from @me-no-dev
and this one from @PaulStoffregen
|
@Niek thanks for the PR. |
I install the library via the lib manager, so it is on \libdeps. I did not manage to get it work, what would be the path ?
|
See 72dd589#r35810441: that commit breaks compilation for me because a
<time.h>
include is missing:Simply adding
#include <time.h>
to FS.h doesn't resolve the issue, seemingly because it includes the wrong header file. Adding#include "~/.platformio/packages/framework-arduinoespressif8266@src-31d658a59f41540201fc3726a1394910/tools/sdk/libc/xtensa-lx106-elf/include/time.h"
or#include "../../tools/sdk/libc/xtensa-lx106-elf/include/time.h"
does work, but that doesn't seem like a good solution. Any ideas?The text was updated successfully, but these errors were encountered: