Re: Space check
- Posted by Irv <irv at ELLIJAY.COM> Jul 25, 1998
- 633 views
Patrick Quist wrote: > > Hello, > > Does somebody know how to check > your harddisk for disk space ? > Greetings: Here is a short routine (written by Jiri or Jacques?) I've lost the original, sorry I can't credit it better. include machine.e include wildcard.e global function dskspace(integer drive_num) -- returns the number of available bytes on a disk, 0 if drive not recognized -- drive_num 0 is the default, 1 is A: etc... sequence reg_list reg_list = repeat(0, 10) reg_list[REG_AX] = #3600 -- call DOS function 36H reg_list[REG_DX] = drive_num reg_list = dos_interrupt(#21, reg_list) -- BX: available clusters; CX: bytes per cluster; AX: sectors per cluster -- Note: DX * CX * AX gives the total number of bytes on the disk return reg_list[REG_BX] * reg_list[REG_CX] * reg_list[REG_AX] end function -- dskspace Regards, Irv http://www.mindspring.com/~mountains -- Euphoria programming archives