The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
check cpu usage gholdbhurg Shell Programming and Scripting 3 03-25-2008 11:06 AM
disk usage rrs Shell Programming and Scripting 1 04-13-2007 04:48 AM
disk usage karthikosu UNIX for Dummies Questions & Answers 2 06-29-2006 04:48 PM
Disk Usage lewisoco UNIX for Dummies Questions & Answers 3 05-09-2006 09:44 PM
Disk usage (Mac OS 10.4) H1tokori UNIX for Dummies Questions & Answers 5 12-05-2005 07:37 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-20-2005
SriSri SriSri is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 2
Check the Disk usage Programmatically

Hi all,

Do we have anyway to get the freediskspace for within a C program?

I need functionality similar to 'df -h' -> which gives the % of utilization...

Otherwise, if we go and use 'system ("df -h /home/myhome/")', do we have any way of capturing the output into a string and parse the string to get the % of utilization?


-Sri
  #2 (permalink)  
Old 09-20-2005
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Check the man pages for popen and pclose. This will allow you to read the output of a command that has been execed using shell.
  #3 (permalink)  
Old 09-20-2005
SriSri SriSri is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 2
Thanks for the info blowtorch...
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:28 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0