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

Discussion in 'C Programming' started by Vikas, Jun 26, 2003.

  1. Vikas

    Vikas Guest

    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
    Vikas, Jun 26, 2003
    #1
    1. Advertising

  2. Vikas <> scribbled the following:
    > 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?


    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>

    --
    /-- Joona Palaste () ---------------------------\
    | Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
    | http://www.helsinki.fi/~palaste W++ B OP+ |
    \----------------------------------------- Finland rules! ------------/
    Joona I Palaste, Jun 26, 2003
    #2
    1. Advertising

  3. On Thu, 26 Jun 2003 04:16:02 -0700, Vikas wrote:

    > 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
    Nils Petter Vaskinn, Jun 26, 2003
    #3
  4. On 26 Jun 2003 04:16:02 -0700, in comp.lang.c ,
    (Vikas) wrote:

    >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".

    --
    Mark McIntyre
    CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
    CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>


    ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
    ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
    Mark McIntyre, Jun 26, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stephane Guyetant

    Hard Disk Drive behavioral model

    Stephane Guyetant, Oct 2, 2003, in forum: VHDL
    Replies:
    0
    Views:
    547
    Stephane Guyetant
    Oct 2, 2003
  2. Ahmed Essa

    hard disk serial number

    Ahmed Essa, Nov 17, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    494
    Nick Hertl
    Nov 17, 2005
  3. Shonty

    SCSI Hard Disk Number

    Shonty, Jan 7, 2005, in forum: C++
    Replies:
    2
    Views:
    2,800
    Shonty
    Jan 7, 2005
  4. Replies:
    0
    Views:
    317
  5. Dr. John P. Costella

    Running CGI through browser from local hard disk

    Dr. John P. Costella, Jul 16, 2003, in forum: Perl Misc
    Replies:
    11
    Views:
    226
    William Alexander Segraves
    Jul 19, 2003
Loading...

Share This Page