Category : Files from Magazines
Archive   : DDJ8706.ZIP
Filename : DUNCAN.EXP

 
Output of file : DUNCAN.EXP contained in archive : DDJ8706.ZIP
þ2«
¥$$$$$
%
%
#include
#include
#include

main(argc,argv)
int argc;
char *argv[];
{ struct stat buf1, buf2;
int result,k;
if ( argc < 3 ) {
printf("chkdate: usage chkdate f1 f2 .. fn\n");
printf(" will return errorlevel 1\n");
printf(" if f1 older than f2 .. fn\n");
printf(" or if f1 .. fn don't exist.\n");
exit(1);
};
if ( stat( argv[1], &buf1 ) != 0 )exit(1);
for ( k=2; k if ( stat( argv[k], &buf2 ) != 0 ) exit(1);
if ( buf1.st_atime < buf2.st_atime ) exit(1);
};
exit(0);
}

Example 1: Phil Marchand's CHKDATE.C program



chkdate main.obj main.c
IF ERRORLEVEL 1 goto :compile1
goto :next1

:compile1
msc main,main;

:next1
chkdate func.obj func.c

IF ERRORLEVEL 1 goto :compile2
goto :next2

:compile2
msc func,func;

:next2
chkdate main.exe main.obj func.obj

IF ERRORLEVEL 1 goto :link
goto :exit

:link
link main.obj+func.obj,main.exe;

:exit

Example 2: TEST.BAT file, a demonstration of the use of the CHKDATE program in a batch file to automate the compilation and linking of an application



; FUNCTION DriveCnt : Integer;
; (C) 1986 George F. Smith & Company
;
; Purpose:
; Returns number of logical drives on host
; computer - DOS 2.0 and above.
;
; Sample Usage (Turbo Pascal):
; Writeln('Number of drives is ',DriveCnt);
;
; Suggested processing sequence:
; MASM DriveCnt,,,
; Link DriveCnt
; Exe2Bin DriveCnt DriveCnt.com
; C2I DriveCnt.com >DriveCnt.inl
;
; (C2I utility converts .com files to Turbo Pascal
; inline code. See DDJ, 10/86, pg. 90 )p
;
code segment
assume cs:code

DriveCnt:
push bp ; standard
mov bp,sp ; subroutine
push ds ; overhead
sub sp,64 ; create scratch area,
mov si,sp ; save in si for 47h call
mov ah,19h ; get default drive
int 21h ; returns drive code in al
mov dl,al ; move code to dl
mov ah,0eh ; set default drive to itself
int 21h ; On return, al=# drives
;
; If DOS 3.0 or above, number of drives in al will
; be minimum of 5. Will repeat calls to function 47h
; until a valid drive code is obtained.
;
mov dl,al ; number of drives in dl
push ss ; segment address
pop ds ; of scratch buffer
search: mov ah,47h ; is drive code okay?
int 21h ; carry flag set if
; drive code invalid
jnc okay ; jump if code valid
dec dl ; drive code too big;
; decrement it and
jmp search ; try again
okay: xor dh,dh ; clear dh
mov [bp+4],dx ; give results to caller
add sp,64 ; adjust stack ptr
pop ds ; restore caller's regs
mov sp,bp
pop bp
ret
code ends

end DriveCnt

Example 3: George Smith's DRIVECNT routine to determine the number of disk drives present in an MS-DOS system


 ; clear dh
mov [bp+4],dx ; give results to caller
add sp€
¥w: åÿ€zT`€Äz&.œ€Word RescueQ @<˜ÿþ˜€€ÿÿ”ÿÿ«ÿÿÁÿÿÂÿÿÒÿÿÜÿÿêÿÿÿÿÿÿ/ÿÿgÿÿžÿÿÖÿÿÿÿ!ÿÿ,ÿÿ[ÿÿ{ÿÿ±ÿÿ€±çÿÿòÿÿÿÿÿÿÿÿÿ0ÿÿ1ÿÿ2ÿÿ3ÿÿ4ÿÿLÿÿkÿÿwÿÿxÿÿ‚ÿÿ‘ÿÿ’ÿÿ™ÿÿ±ÿÿ²ÿÿ€²ÑÿÿÝÿÿÞÿÿèÿÿ÷ÿÿøÿÿÿÿÿ"ÿÿ#ÿÿ>ÿÿIÿÿJÿÿPÿÿqÿÿrÿÿxÿÿyÿÿÿÿÿÿÿÿ€ÿÿÿÿ:ÿÿfÿÿhÿÿzÿÿ¯ÿÿÙÿÿÛÿÿÿÿ7ÿÿ9ÿÿaÿÿ~ÿÿ˜ÿÿÂÿÿíÿÿïÿÿ,ÿÿ_ÿÿ€_aÿÿrÿÿŠÿÿ‹ÿÿ•ÿÿ½ÿÿçÿÿÿÿCÿÿzÿÿ«ÿÿãÿÿ ÿÿ Mÿÿ ƒÿÿ …ÿÿ ¼ÿÿ öÿÿ
"ÿÿ
$ÿÿ€
$
Zÿÿ
‰ÿÿ
¼ÿÿ
ïÿÿ ÿÿ Rÿÿ „ÿÿ ·ÿÿ éÿÿ ÿÿ <ÿÿ rÿÿ ¢ÿÿ ×ÿÿ ìÿÿ þÿÿ
ÿÿ
ÿÿ
ÿÿ
2ÿÿ€
2
3ÿÿ
¢ÿÿ
£ÿÿ
¤ÿÿ
¦ÿÿ Rÿÿ „ÿÿ ·ÿÿ éÿÿ ÿÿ <ÿÿ rÿÿ ¢ÿÿ ×ÿÿ ìÿÿ þÿÿ
ÿÿ
ÿÿ
ÿÿ
2ÿÿ€

  3 Responses to “Category : Files from Magazines
Archive   : DDJ8706.ZIP
Filename : DUNCAN.EXP

  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/