LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 11-21-2011, 06:39 AM   #1
vipulspn
LQ Newbie
 
Registered: Aug 2009
Posts: 11

Rep: Reputation: 0
api to list Filesystem names (c++)


Hi,

How can I list Filesystem name if I have a path in c++.

for example: if i fire following command on shell:
df -k /someloc

Filesystem 1K-blocks Used Available Use% Mounted on
machine3:/someloc 18874 13808 15066 74% /some1/some2/someloc

I just want output Filesystem name. I looked into df source code. I could not understand it much. I was wondering if there was a simple way to achieve the task.

Thanks,
Vipul
 
Old 11-21-2011, 10:52 PM   #2
jthill
Member
 
Registered: Mar 2010
Distribution: Arch
Posts: 211

Rep: Reputation: 67
You asked this already, and I told you the API: read /proc/self/mounts and find the longest matching prefix. The only thing I didn't do was to actually write the C++ for you.
 
  


Reply



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
List 4 names from users list and output them to fbusers in numbered ascending order? fezzie Programming 4 02-10-2010 01:05 PM
get list of thread of running process using C api (in my c code) Jodha Linux - Newbie 1 01-29-2010 07:33 AM
List of names xowl General 28 04-10-2007 05:08 PM
Login screen with list of names BaltikaTroika SUSE / openSUSE 3 11-18-2005 10:53 PM
kernal API list lordofring Programming 1 08-02-2005 03:40 PM

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

All times are GMT -5. The time now is 12:55 AM.

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