version 1.3, 1997/01/15 23:43:22 |
version 1.4, 2000/09/20 13:26:55 |
|
|
|
|
for (rval = 0; *argv; ++argv) { |
for (rval = 0; *argv; ++argv) { |
/* See if the file exists. */ |
/* See if the file exists. */ |
if (stat(*argv, &sb)) |
if (stat(*argv, &sb)) { |
if (!cflag) { |
if (!cflag) { |
/* Create the file. */ |
/* Create the file. */ |
fd = open(*argv, |
fd = open(*argv, |
|
|
continue; |
continue; |
} else |
} else |
continue; |
continue; |
|
} |
|
|
if (!aflag) |
if (!aflag) |
TIMESPEC_TO_TIMEVAL(&tv[0], &sb.st_atimespec); |
TIMESPEC_TO_TIMEVAL(&tv[0], &sb.st_atimespec); |
|
|
if ((t = localtime(&tmptime)) == NULL) |
if ((t = localtime(&tmptime)) == NULL) |
err(1, "localtime"); |
err(1, "localtime"); |
|
|
t->tm_mon = ATOI2(arg); /* MMDDhhmm[yy] */ |
t->tm_mon = ATOI2(arg); /* MMDDhhmm[YY] */ |
--t->tm_mon; /* Convert from 01-12 to 00-11 */ |
--t->tm_mon; /* Convert from 01-12 to 00-11 */ |
t->tm_mday = ATOI2(arg); |
t->tm_mday = ATOI2(arg); |
t->tm_hour = ATOI2(arg); |
t->tm_hour = ATOI2(arg); |
t->tm_min = ATOI2(arg); |
t->tm_min = ATOI2(arg); |
if (year) |
if (year) { |
t->tm_year = ATOI2(arg); |
t->tm_year = ATOI2(arg); |
|
if (t->tm_year < 69) |
|
t->tm_year += 100; |
|
} |
|
|
t->tm_isdst = -1; /* Figure out DST. */ |
t->tm_isdst = -1; /* Figure out DST. */ |
tvp[0].tv_sec = tvp[1].tv_sec = mktime(t); |
tvp[0].tv_sec = tvp[1].tv_sec = mktime(t); |
if (tvp[0].tv_sec == -1) |
if (tvp[0].tv_sec == -1) |
errx(1, |
errx(1, |
"out of range or illegal time specification: MMDDhhmm[yy]"); |
"out of range or illegal time specification: MMDDhhmm[YY]"); |
|
|
tvp[0].tv_usec = tvp[1].tv_usec = 0; |
tvp[0].tv_usec = tvp[1].tv_usec = 0; |
} |
} |