Page 1 of 1

mkdir

Posted: Thu Apr 14, 2022 4:39 pm
by bmartin0
Hi,
I'm trying to create a folder on an sd card. When I used the following mkdir("/sdcard/sysdl") I get a folder that is created on the sd card named sysdl. I've noticed that, when looking at the sd card in windows explorer, the date on the folder is 12/31/1979 at 11:00 pm.
Does anyone know of a method to put the current date using mkdir? I have an RTC on my board so I can provide the date/time in any format required, just don't know how to modify mkdir call appropriately.
Thanks,

Re: mkdir

Posted: Fri Apr 15, 2022 2:11 am
by ESP_Sprite
I think those calls use the system time... if you have a RTC, you can probably use the settimeofday() call to inform ESP-IDF of the correct date and time.

Re: mkdir

Posted: Fri Apr 15, 2022 9:33 am
by bmartin0
Thanks, I'll take a look at settimeofday() and see what I can do.