Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site wateng.UUCP Path: utzoo!watmath!wateng!broehl From: broehl@wateng.UUCP (Bernie Roehl) Newsgroups: net.micro.pc Subject: Re: WANTED -- DeSmet C Help. Message-ID: <1148@wateng.UUCP> Date: Fri, 29-Jun-84 09:35:03 EDT Article-I.D.: wateng.1148 Posted: Fri Jun 29 09:35:03 1984 Date-Received: Sun, 1-Jul-84 01:54:28 EDT References: <1338@ucf-cs.UUCP> Organization: U of Waterloo, Ontario Lines: 47 Yes, you can do the equivalent of a stat() on files from DeSmet. There are various approaches, depending on what information you need. The following is one possible approach: struct { char reserved[21]; char attr; unsigned ftime; unsigned fdate; long fsize; char fname[13]; } dta; _os(0x1A, dta); /* set up the disk transfer area */ _os(0x4E, "frodo.txt"); The second _os() call does a "Find First", which fills the dta with infor- mation about the first file matching the pattern given by the string. (Yes, you can use wildcard characters). Subsequent _os() calls using 4F instead of 4E will return info about additional files matching the pattern. HOWEVER, the use of _os() for this is tricky, since the DOS 2.00 manual says (on page D-49, under the 0x4E call description) that CX contains an attribute byte, and that only files mathcing that attribute will be found. Thus a safer way of doing it is to replace the second _os() call above with the following: _rax = 0x4F00; _rcx = 0x0010;/* the 1-bit indicates directories are ok too */ _rdx = "frodo.txt"; _rds = _showds(); _doint(0x21); /* invoke DOS */ This requires (a) that you have release 2.3 (2.2?) or above of DeSmet (i.e. that you have the _doint() function, and (b) that you have previously declared the following: extern unsigned _rax, _rcx, _rdx, _rds; The variable _carryf can be used to determine if there were any problems. Have fun! -- -Bernie Roehl (University of Waterloo) ...decvax!allegra!watmath!watrose!wateng!broehl