X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Doug Kaufman Newsgroups: comp.os.msdos.djgpp Subject: Re: Problem with UNRAR Date: Thu, 6 Jan 2005 05:18:57 +0000 (UTC) Organization: a2i network Lines: 40 Message-ID: References: <01c4f3ab$Blat.v2.2.2$28b62780 AT zahav DOT net DOT il> NNTP-Posting-Host: green.rahul.net X-Trace: blue.rahul.net 1104988737 19037 192.160.13.49 (6 Jan 2005 05:18:57 GMT) X-Complaints-To: support AT rahul DOT net NNTP-Posting-Date: Thu, 6 Jan 2005 05:18:57 +0000 (UTC) User-Agent: nn/6.6.4 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Eli Zaretskii" writes: >> From: Doug Kaufman >> Date: Wed, 5 Jan 2005 20:45:48 +0000 (UTC) >> >> +#ifdef __DJGPP__ >> + { >> + __dpmi_regs regs; >> + memset(®s,0,sizeof(regs)); >> + regs.h.ah=0x36; >> + regs.h.dl=Drive; >> + __dpmi_int (0x21, ®s); >> + if (regs.x.ax==0xffff) >> + return(1457664); >> + Int64 FreeSize=regs.x.ax*regs.x.cx; >> + FreeSize=FreeSize*regs.x.bx; >> + return(FreeSize); >> + } >> +#else >Why work so hard when DJGPP has the `statfs' function which will return >the disk free space? I just modified the author's code to use __dpmi_int instead of the _int86 in the original code. I didn't think about more efficient ways to do it. Thanks for the suggestion. I presume that you are talking about doing something like: struct statfs fs; statfs(Drive, &fs); FreeSize=fs.f_bfree*fs.f_bsize; return(FreeSize); I am not a programmer, so I am usually happy just to get something to work for me when I try to port a program. I'll try to remember that we have statfs if the need arises with other programs. Doug -- Doug Kaufman Internet: dkaufman AT rahul DOT net