Category : Files from Magazines
Archive   : VOL7N9.ZIP
Filename : TRYTD.C

 
Output of file : TRYTD.C contained in archive : VOL7N9.ZIP
/*
TRYTD.C: Demo of TD.C Time & Date Formatting Functions

Ray Duncan, December 1987

Compile: C>CL TRYTD.C TD.C

*/

#include
#include
#include

union REGS regs;

extern char * systcvt(int); /* function prototypes */
extern char * sysdcvt(int);
extern char * dirtcvt(int, unsigned);
extern char * dirdcvt(int, unsigned);
extern char * tcvt(int, int, int, int, int);
extern char * dcvt(int, int, int, int);

main()
{
char *tstr; /* pointer to formatted time */
char *dstr; /* pointer to formatted date */
unsigned dirtime,dirdate;

tstr = systcvt(11); /* format current time */
dstr = sysdcvt(8); /* format current date */

/* display time & date */
printf("\nThe current time and date are: %s %s\n", tstr, dstr);

regs.x.ax = 0x3d00; /* open TRYTD.EXE file */
(char * ) regs.x.dx = "TRYTD.EXE";
int86(0x21, ®s, ®s);

if(regs.x.cflag) /* exit if open failed */
{ puts("Can't open TRYTD.EXE");
exit(1);
}

regs.x.bx = regs.x.ax; /* get file date & time */
regs.x.ax = 0x5700;
int86(0x21, ®s, ®s);
dirtime = regs.x.cx;
dirdate = regs.x.dx;

regs.x.ax = 0x3e00; /* close the file */
int86(0x21, ®s, ®s); /* BX still has handle */

tstr = dirtcvt(11, dirtime); /* format directory time */
dstr = dirdcvt(8, dirdate); /* format directory date */

/* display time & date */
printf("\nThe TRYTD.EXE file time and date are: %s %s\n",
tstr, dstr);

}




  3 Responses to “Category : Files from Magazines
Archive   : VOL7N9.ZIP
Filename : TRYTD.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/