home *** CD-ROM | disk | FTP | other *** search
- /*---------------------------------------------------------------------------
-
- atari.c
-
- Atari TOS-specific routines for use with Info-ZIP's UnZip 5.1 and later.
-
- This is basically the MS-DOS version and has never been tested on the
- Atari. MODIFY AT WILL! (It almost certainly will not work correctly,
- and probably won't even compile correctly.)
-
- ---------------------------------------------------------------------------*/
-
-
- #include "unzip.h"
-
-
-
-
- /**********************/
- /* Function mapattr() */
- /**********************/
-
- int mapattr() /* what do Atari attribute bits mean? */
- {
- /* only care about read-only bit, so just look at MS-DOS side of attrs */
- pInfo->read_only = (unsigned)(crec.external_file_attributes & 1);
- return 0;
-
- } /* end function mapattr() */
-
-
-
-
-
- /**************************************/
- /* Function set_file_time_and_close() */
- /**************************************/
-
- void set_file_time_and_close()
- {
- #ifdef __TURBOC__
- union {
- struct ftime ft; /* system file time record */
- struct {
- ush ztime; /* date and time words */
- ush zdate; /* .. same format as in .ZIP file */
- } zt;
- } td;
- #endif
-
-
- /*---------------------------------------------------------------------------
- Do not attempt to set the time stamp on standard output.
- ---------------------------------------------------------------------------*/
-
- if (cflag) {
- close(outfd);
- return;
- }
-
- /*---------------------------------------------------------------------------
- Copy and/or convert time and date variables, if necessary; then set the
- file time/date.
- ---------------------------------------------------------------------------*/
-
- #ifdef __TURBOC__
- td.zt.ztime = lrec.last_mod_file_time;
- td.zt.zdate = lrec.last_mod_file_date;
- setftime(outfd, &td.ft);
- #endif /* ?__TURBOC__ */
-
- /*---------------------------------------------------------------------------
- And finally we can close the file...at least everybody agrees on how to
- do *this*. I think... Oh yeah, also change the mode according to the
- stored file attributes, since we didn't do that when we opened the dude.
- ---------------------------------------------------------------------------*/
-
- close(outfd);
-
- #ifdef __TURBOC__
- if (_chmod(filename, 1, pInfo->file_attr) != pInfo->file_attr)
- fprintf(stderr, "\nwarning: file attributes may not be correct\n");
- #endif
-
- } /* end function set_file_time_and_close() */
-