LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-30-2012, 02:57 AM   #1
yahoosam
Member
 
Registered: Jun 2012
Posts: 79

Rep: Reputation: Disabled
list all files in the path through c code


i am need of c code that will list all the files in the path mentioned..
 
Old 06-30-2012, 05:18 AM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Try http://www.cs.cf.ac.uk/Dave/C/node20.html
 
Old 06-30-2012, 05:20 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Google finds a lot of hits on how to do this---what I saw mentioned several times was "dirent.h"
 
Old 06-30-2012, 09:47 AM   #4
yahoosam
Member
 
Registered: Jun 2012
Posts: 79

Original Poster
Rep: Reputation: Disabled
well i want a function to call from my program that will give me list of files in my current directory..
But not through system() function...

Any library or header files!please mension in here..
 
Old 07-01-2012, 04:58 AM   #5
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Neither my link nor the library pixellany mentioned has any mention of the system() function. It seems my link was specific to BSD, so if you're using Linux then look at the dirent.h library (hint: type 'dirent.h' into google and click on the first link that isn't wikipedia).
 
Old 07-01-2012, 06:16 PM   #6
doughyi8u
Member
 
Registered: Apr 2010
Posts: 254

Rep: Reputation: 10
Have a look at this link http://stackoverflow.com/questions/6...y-using-c-or-c
 
  


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
[SOLVED] Perforce edits my files when I give a depot path but not if I specify the local path gregorian Linux - Software 1 10-21-2011 11:57 AM
Perforce edits my files when I give a depot path but not if I specify the local path gregorian Linux - Software 1 10-07-2011 05:03 PM
script to change unix path to windows path in all files csross Programming 8 04-29-2006 01:05 PM
How to list files in subdirectrories with relative path? Lotharster Linux - Newbie 5 01-28-2006 01:06 PM
List files without path mijohnst Programming 2 12-05-2005 03:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:57 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