Hi,
I want to calculate disk free and used space before saving a file on it. thru which c++ api can i achieve this.
I need urgent help. Any one please help me.
Regards,
Gh
Thru which C++ API can I calculate disk space?
-
nullify
Re:Thru which C++ API can I calculate disk space?
It sounds like you're asking for help at the wrong place. This forum is for OS development. (ie., generally not programming for an existing system)
If your question is about OS development, then you'll either have to port a C++ API capable of doing this to your system, or write your own. Both require some underlying support (low-level hard drive interaction and a file system) to accomplish.
If your question is about OS development, then you'll either have to port a C++ API capable of doing this to your system, or write your own. Both require some underlying support (low-level hard drive interaction and a file system) to accomplish.
-
Gh
Re:Thru which C++ API can I calculate disk space?
No this is the write place to ask
I am implementing file system now a days and in that i want to use C++ API I searched on the net but didn't find any. That's why I post the message on that forum so that if every one have ever used such an API plz refer me that API.
Re:Thru which C++ API can I calculate disk space?
Repeat rule #3 of OS programming: Unless you implemented the "standard" includes yourself (or ported some standard library to your OS), there are no standard includes.Gh wrote: I am implementing file system now a days and in that i want to use C++ API I searched on the net but didn't find any.
That being said, neither the C nor the C++ standard library provide any means of calculating free disk space, because this is OS dependent.
Every good solution is obvious once you've found it.
-
Ozguxxx
Re:Thru which C++ API can I calculate disk space?
Well I think your (referring to Gh) problem is more basic one. I think searching for how API is serviced by OPERATING SYSTEM is more meaningful to you before interfacing with fs driver, which in later stage will be written by you. Most c API is not coded in BIOS. Well, some of it might be but fs API is dependent on OPERATING SYSTEM, not bios...
- Pype.Clicker
- Member

- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Thru which C++ API can I calculate disk space?
Depending on which OS you'll develop your filesystem for, the API will be different.Gh wrote: No this is the write place to askI am implementing file system now a days and in that i want to use C++ API I searched on the net but didn't find any. That's why I post the message on that forum so that if every one have ever used such an API plz refer me that API.
You're likely to use the "block device interface" if you're working for Linux, or something from the Windows Device Development Kit (internals unknown) , thus making "read block" and "write blocks". Knowing the available amount of free space basically will consist of reading the Master Boot Record (MBR) for your disk and try to locate unpartitionned / unused space.
-
Tim
Re:Thru which C++ API can I calculate disk space?
The C++ language doesn't know about "disks" and "space". Any method of determining the free space on a system which might support disks is operating system dependent. As you're writing your own OS, you will need to create your own function from scratch.Gh wrote:I want to calculate disk free and used space before saving a file on it. thru which c++ api can i achieve this.