Joined: 11 Jul 2011 Posts: 79 Location: United States
Posted: Sun Aug 18, 2013 11:13 pm Post subject: changing file date and time
After I've written data to a file on the SD card, is it possible to set the file create date and time?
I hate that my logged files always have a date of 1/1/2001 12:00AM.
Thanks.
Joined: 25 Jul 2007 Posts: 284 Location: PA near Philly
Posted: Sun Oct 20, 2013 1:32 pm Post subject:
Jeremy,
Files written or updated will get the current "system" real time. The issue is, it you don't setup the systems real time and use an interupt to update it then the time stamp that will be used will be 1/1/2001 12:00AM. There are two things you can do to solve this.
Joined: 17 Jun 2004 Posts: 269 Location: Austria, Hard
Posted: Sat Oct 26, 2013 6:17 am Post subject:
Hi,
as Glena said, AVR-DOS uses the "system-Time" generated by the "CONFIG CLOCK" command. If you can't use the SOFT - Option, because you have not the appropriate timer, you have provide the data/time anyway with an other method.
In this case you have to use the USER Option of the CONFIG CLOCK command. The compiler generates the variables _sec, _min, _hour, _day, _month, _year. If you change this variables to the actual time in your code, then AVR-DOS uses this information for the file-date. You can also use the Date$ and Time$ command. _________________ regards Josef
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum