Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Determine Space USED on CD


6 replies to this topic

Andrew S

Andrew S
  • Members
  • 11 posts

Posted 06 December 2001 - 13:22

We have 3 data bases (50/100/300MB) and would like to know if IS can detect the amount of space USED on a CD.  

Then we can compare that to the Target PC using DiskSpace function to see if it can fit.  

The alternaive is to hard code database sizes in the script but that would require 3 different scripts (and monthly updates) - this way we can use one script for all builds with no updates.  

Thanks


lasenbby

lasenbby
  • Members
  • 744 posts

Posted 06 December 2001 - 15:36

GetDiskSpace will tell the amount of free space.  And you know that your cds are a certain size; take the difference.  If you are wanting to get the disk space of a dir down, then you can just do a "dir /s" piped into a temp file and then find "Total..." which will be at the bottom of the file and basically look like this:
Total Files Listed:
      7696 File(s)    980,891,429 bytes
       407 Dir(s)     284,395,008 bytes free

So you would do a grep for "Total Files Listed:" and get the line number then get the line after that and parse out the size.  

Kind of drawn out process so maybe someone will post a better way...

It's too bad the component size functions don't work with script created media or that would be a good way.


Andrew S

Andrew S
  • Members
  • 11 posts

Posted 06 December 2001 - 16:40

The trouble is that as GetDiskSpace returns the amount of FREE disk space...that is always zero as the CD's are closed.  

IT sure is too bad about the component function...

Any more ideas?


lasenbby

lasenbby
  • Members
  • 744 posts

Posted 06 December 2001 - 17:13

You don't want to pipe the output of the dir command into a temp file and parse it?

Perotin

Perotin
  • Full Members
  • 407 posts

Posted 06 December 2001 - 18:18

do you want to check the cd (or a part of it) for the used disk space?
why don't you use findallfiles to search for all files on cd or that have a defines name/extension and add the file size of the files found?

Perotin

Perotin
  • Full Members
  • 407 posts

Posted 06 December 2001 - 18:20

btw: is getdiskspace in is6 able to return > 2gb?

lasenbby

lasenbby
  • Members
  • 744 posts

Posted 06 December 2001 - 18:25

GetDiskSpaceEx (szPath, nUnits);
IS doc:
The limit of GetDiskSpaceEx is 2 giga-units (2 31) of the measurement unit you pass in nUnits. When you specify BYTES, the limit is 2 GB; when you specify KBYTES, the limit is **2 TB**; and so on. You should specify KBYTES for most setups.