There are a lot of problems (it seems ) with the time stamps on smbfs in
linux (I looked at this, I can't get consistent behavior against win95...
I'm fixed the date stuff and I'm seeing the very "strange results"...
What works well if I make/touch the file on DOS, the times on linux makes
sense.
[even after I fixed the obvious problem of indexes an array with -1
(in smbfs/proc.c, what if date is 0?
tatic int
date_dos2unix(unsigned short time,unsigned short date)
{
int month,year,secs;
month = ((date >> 5) & 15)-1;
/* what if month < 0? */
year = date >> 9;
secs = (time & 31)*2+60*((time >> 5) & 63)+(time >> 11)*3600+86400*
((date & 31)-1+day_n[month]+(year/4)+year*365-((year & 3) == 0 &&
month < 2 ? 1 : 0)+3653);
/* days since 1.1.70 plus 80's leap day */
return local2utc(secs);
}
Also, can we write algorithms which are more readable by people?
(this is major cryptic...)
Also, why are there more entries in the month to day array?
* Linear day numbers of the respective 1sts in non-leap years. */
static int day_n[] = { 0,31,59,90,120,151,181,212,243,273,304,334,0,0,0,0 };
/* JanFebMarApr May Jun Jul Aug Sep Oct Nov Dec */
-- marty leisner@sdsp.mc.xerox.com Member of the League for Programming Freedom