Oops.... (SpaceCheck)

new topic     » goto parent     » topic index » view thread      » older message » newer message

To Patrick Quist

Hello,

I've lost the code that checks your harddisk for space that is left.
Can someone sent it again please????????????

Thanks.....

P.Quist

Here is your code. I=B4ll paste it in. Alsjeblieft

include machine.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 =3D repeat(0, 10)
    reg_list[REG_AX] =3D #3600        -- call DOS function 36H
    reg_list[REG_DX] =3D drive_num
    reg_list =3D 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


printf(1, "%\n", dskspace(0))

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu