LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-08-2004, 07:22 AM   #1
vidi
LQ Newbie
 
Registered: Jun 2004
Location: romania
Posts: 3

Rep: Reputation: 0
programmatic disk free information


Hello everybody,

I'm writing an application that has to run on SuSE and on Montavista. I need to see the amount of disk space available. So far the only option I found was to do a 'df' and then parse the result.

Do you know any other solution to this? I would prefer to do it programmatic way since I think it would be faster and safer (something similar to accessing /proc/meminfo for information about memory usage).

Thanks,
vidi
 
Old 06-08-2004, 09:39 AM   #2
csfalcon
Member
 
Registered: Jun 2004
Location: MD
Distribution: Fedora Core
Posts: 269

Rep: Reputation: 31
Hi,

These functions are what you are looking for
Code:
man getmntent

man getfsent
 
Old 06-10-2004, 01:27 AM   #3
vidi
LQ Newbie
 
Registered: Jun 2004
Location: romania
Posts: 3

Original Poster
Rep: Reputation: 0
These functions will give me the partition list. They are useful BUT what I need is for each mounted partition to get its size and the available/used space.

Basically what I need is exactly what the command 'df' does but I have to do it in my program. I wouldn't use df as I want to have as little dependencies as possible.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
API for getting free space information in Linux. srns Programming 5 04-26-2005 05:52 PM
Hard disk Information alint7 Linux - Hardware 7 04-11-2005 09:16 AM
rm doesn't free the disk space krizzz Linux - General 5 02-16-2005 11:27 AM
Free up disk space TheShemeta Slackware 5 11-26-2003 04:50 PM
How to see free disk space bripage Linux - General 3 04-29-2002 08:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration