Archive-Unzip-Burst
view release on metacpan or search on metacpan
unzip-6.0/atari/atari.c view on Meta::CPAN
fclose(G.outfile);
/*---------------------------------------------------------------------------
Convert from MSDOS-format local time and date to Unix-format 32-bit GMT
time: adjust base year from 1980 to 1970, do usual conversions from
yy/mm/dd hh:mm:ss to elapsed seconds, and account for timezone and day-
light savings time differences.
---------------------------------------------------------------------------*/
/* skip restoring time stamps on user's request */
if (uO.D_flag <= 1) {
#ifdef USE_EF_UT_TIME
eb_izux_flg = (G.extra_field
#ifdef IZ_CHECK_TZ
&& G.tz_is_valid
#endif
? ef_scan_for_izux(G.extra_field,
G.lrec.extra_field_length, 0,
G.lrec.last_mod_dos_datetime, &zt, NULL)
: 0);
if (eb_izux_flg & EB_UT_FL_MTIME) {
tp.modtime = zt.mtime;
TTrace((stderr,
"\nclose_outfile: Unix e.f. modif. time = %ld\n",
tp.modtime));
} else {
tp.modtime = dos_to_unix_time(G.lrec.last_mod_dos_datetime);
}
if (eb_izux_flg & EB_UT_FL_ATIME) {
tp.actime = zt.atime;
TTrace((stderr,
"close_outfile: Unix e.f. access time = %ld\n",
tp.actime));
} else {
tp.actime = tp.modtime;
TTrace((stderr,
"\nclose_outfile: modification/access times = %ld\n",
tp.modtime));
}
#else /* !USE_EF_UT_TIME */
tp.actime = tp.modtime
= dos_to_unix_time(G.lrec.last_mod_dos_datetime);
TTrace((stderr, "\nclose_outfile: modification/access times = %ld\n",
tp.modtime));
#endif /* ?USE_EF_UT_TIME */
/* set the file's access and modification times */
if (utime(G.filename, &tp))
Info(slide, 0x201, ((char *)slide,
"warning: cannot set the time for %s\n",
FnFilter1(G.filename)));
}
/*---------------------------------------------------------------------------
Change the file permissions from default ones to those stored in the
zipfile.
---------------------------------------------------------------------------*/
#ifndef NO_CHMOD
if (chmod(G.filename, 0xffff & G.pInfo->file_attr))
perror("chmod (file attributes) error");
#endif
} /* end function close_outfile() */
#ifdef TIMESTAMP
/***************************/
/* Function stamp_file() */
/***************************/
int stamp_file(fname, modtime)
ZCONST char *fname;
time_t modtime;
{
ztimbuf tp;
tp.modtime = tp.actime = modtime;
return (utime(fname, &tp));
} /* end function stamp_file() */
#endif /* TIMESTAMP */
#ifndef SFX
/************************/
/* Function version() */
/************************/
void version(__G)
__GDEF
{
#ifdef __TURBOC__
char buf[40];
#endif
sprintf((char *)slide, LoadFarString(CompiledWith),
#ifdef __GNUC__
"gcc ", __VERSION__,
#else
# if 0
"cc ", (sprintf(buf, " version %d", _RELEASE), buf),
# else
# ifdef __TURBOC__
"Turbo C", (sprintf(buf, " (0x%04x = %d)", __TURBOC__, __TURBOC__), buf),
# else
"unknown compiler", "",
# endif
# endif
#endif
#ifdef __MINT__
"Atari TOS/MiNT",
( run in 1.266 second using v1.01-cache-2.11-cpan-bbcb1afb8fc )