Welcome, Guest. Please login or register.

Author Topic: Blitz: DosElmoreLib incorrectly reporting DiskUsed  (Read 2012 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Blitz: DosElmoreLib incorrectly reporting DiskUsed
« on: August 30, 2006, 07:31:14 AM »
I have already mentioned this in another thread but thought I would start a new one as it's a new problem.

I'm using DosElmoreLib to try and get a list of volumes and their sizes. I'm having problems with the DiskUsed function, in that it returns a value which is far too small. For example:

AnalyzeDisk "HD1:"
Print DiskUsed


returns a negative value!

The partition is 16GB in size and has just over 2GB of data on it. I don't know if that's anything to do with the problem. I ran the same routine on HD0: which is 1GB in size and has 27MB of data on it, and it correctly reported the amount of used space on the drive. However, I also get negative values from RAM: and DF0:.

Is this a bug, or am I doing something wrong? I'm using OS3.9 if that makes any difference.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Blitz: DosElmoreLib incorrectly reporting DiskUsed
« Reply #1 on: August 30, 2006, 08:01:37 AM »
It calculates the disk size using signed 32bit math. If the partition size is >2GB it b0rks.

Quote
However, I also get negative values from RAM: and DF0:.

Well, if that happens then the routine is broken even more ways than just 32bit signed math.
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Blitz: DosElmoreLib incorrectly reporting DiskUsed
« Reply #2 on: August 30, 2006, 08:04:43 AM »
I thought as much. Do you now of any other way to find the used space on the volume, other than parsing the output from C:info for the number of used blocks and multiplying by the blocksize of the partition?

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Blitz: DosElmoreLib incorrectly reporting DiskUsed
« Reply #3 on: August 30, 2006, 08:35:08 AM »
Call dos.library/Info() yourself and use 64bit math to calculate sizes.
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Blitz: DosElmoreLib incorrectly reporting DiskUsed
« Reply #4 on: August 30, 2006, 08:49:51 AM »
Ok, thanks for the tip. I'll do some research and find out what I need to do to call the library function, and the syntax of the info() function.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Blitz: DosElmoreLib incorrectly reporting DiskUsed
« Reply #5 on: August 30, 2006, 09:01:49 AM »
Right, I don't have a clue how you can do that in Blitz, anyway. Maybe someone with a blitz clue could help?