Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

changing file date and time

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR-DOS
View previous topic :: View next topic  
Author Message
jeremywilson

Bascom Member



Joined: 11 Jul 2011
Posts: 79
Location: United States

usa.gif
PostPosted: Sun Aug 18, 2013 11:13 pm    Post subject: changing file date and time Reply with quote

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.
Back to top
View user's profile AIM Address
glena

Bascom Member



Joined: 25 Jul 2007
Posts: 284
Location: PA near Philly

usa.gif
PostPosted: Sun Oct 20, 2013 1:32 pm    Post subject: Reply with quote

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.

1) Setup the system time and use an interrupt to keep it updated. See here for details: http://avrhelp.mcselec.com/index.html

2) Setup the clock but with out the irq and just set DATE$ & TIME$ to what you want just prior to writing.

-Glen

_________________
http://bahbots.com
Back to top
View user's profile AIM Address
oe9vfj

Moderator



Joined: 17 Jun 2004
Posts: 269
Location: Austria, Hard

austria.gif
PostPosted: Sat Oct 26, 2013 6:17 am    Post subject: Reply with quote

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

DOS - File System for BASCOM-AVR on http://members.aon.at/voegel
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR-DOS All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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