Finding Hard Disk Memory Left On the Computer Through C/VC++

V

Vikas

Hi all,

I am developing an application which should stop once the memory
available on the Hard Disk goes below a threshold value.

Is there a function in C (or) VC++ to determine the current memory
left on the hard disk ??? If there is no direct function, what
methodology can be adopted?

Thanks,
Vikas
 
J

Joona I Palaste

Vikas said:
I am developing an application which should stop once the memory
available on the Hard Disk goes below a threshold value.
Is there a function in C (or) VC++ to determine the current memory
left on the hard disk ??? If there is no direct function, what
methodology can be adopted?

No, there is no direct function in C or C++. There might be one in VC++,
whatever that is. But that would be an implementation-dependent function
and thus off-topic for both comp.lang.c or comp.lang.c++.

<off-topic>Hard disks don't have "memory". The data there is stored in
a form which is not directly accessible by the processor. It is called
"space".</off-topic>
 
N

Nils Petter Vaskinn

Hi all,

I am developing an application which should stop once the memory
available on the Hard Disk goes below a threshold value.

Memory as in availale HD space or as in swap space?
Is there a function in C (or) VC++ to determine the current memory
left on the hard disk ??? If there is no direct function, what
methodology can be adopted?

First: This isn't on topic for clc. I would guess that one of the groups
in comp.os.ms-windows.programmer.* is the right place.

There is probably a windows system call for this. Search the
documentation.

hth
NPV
 
M

Mark McIntyre

Hi all,

I am developing an application which should stop once the memory
available on the Hard Disk goes below a threshold value.

I'd like to point out that "memory" and "disk storage" are not
strictly the same thing. Muddling them up is not a good idea generally
speaking.
Is there a function in C (or) VC++ to determine the current memory
left on the hard disk ???

Well, my hard disk has 8Mb of memory no matter how full it is - thats
the cache size. :)

Other than that no, there's no C function to determine the free space
on a disk. This is because C is designed to function on systems
without disks, such as my Palmpilot, a fridge, or even a diskless
workstation or terminal.
If there is no direct function, what methodology can be adopted?

Your OS probably has a GetFreeSpace() type function though. I suggest
you browse your compiler's online help, probably via a search for
"disk space".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top