Hi!
Probably this problem is easy to solve. Unfortunetately I couldn't
solve it.
Background:
I need to get the Systemtime actually part of it into three variables
with the month, year and day value in order to save them into the
header of a database file so I know when the file was "last accessed".
For all that entire database I found in the public library a few
examples. These were though written for Borland and M$ Compilers which
run under DOS. I though only have my gnu Linux compiler and intent to
write that program for Linux.
So the headerfile "dos.h" does not exsit for me and also not the
functions used from that headerfile.
The actual Problem:
This is just part of the example of one of the books, I need to get
the same result but with a function of the C-library of Linux, I just
type now the entire example which runs for M$ and Borland
What I need is a struct like the date struct or the dosdate_t struct
in a headerfile and also a function which sets the actual date then to
my created object of one of these structs like it works in the
example.
Please don't just tell me to look in the man pages or "try ctime". I
have looked up some stuff in the manpages and also in to "time.h".
What I tried did not work, brought me coredumps or is not what I need
(like getting the time since 1970 in miliseconds or so). Please try to
help me with a short example. Thanks in advance,
Moh.
PS: Please answer me also via email, as I might not found this again.
Here is the Example:
......
int Now[3];
#ifdef TURBO_C_1_0
struct date ToDay;
getdate(&ToDay);
Now[0]=ToDay.da_year-1900;
Now[1]=ToDay.da_mon;
Now[2]=ToDay.da_day;
#endif
#ifdef MS_C_5_1
struct dosdate_t ToDay;
_dos_getdate(&ToDay);
Now[0]=ToDay.year-1900;
Now[1]=ToDay.mon;
Now[2]=ToDay.day;
#endif
......