LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-16-2010, 12:39 PM   #1
nehapawar
LQ Newbie
 
Registered: May 2009
Posts: 22

Rep: Reputation: 15
how to implement ls command in c?


is there any function like mkdir() or link() for command ls?
if not, how is ls implemented ?
 
Old 02-16-2010, 12:55 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
You can get the source code for bash--and the various utilities. I would try sourceforge, or maybe the free software foundation.

OR--Google using something like "ls source code linux".

I would have thought that "ls" was part of the BASH built-ins, but it is on my system as /bin/ls
 
Old 02-16-2010, 12:58 PM   #3
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
I doubt that it's built into bash, why couldn't you make a program that lists files independent?
 
Old 02-16-2010, 04:55 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
http://linux.die.net/man/3/readdir
http://linux.die.net/man/3/opendir
http://linux.die.net/man/3/scandir

and friends
 
Old 02-16-2010, 05:21 PM   #5
tanvir1
LQ Newbie
 
Registered: Apr 2009
Location: Canberra, Australia
Posts: 7

Rep: Reputation: Disabled
Quote:
Originally Posted by nehapawar View Post
is there any function like mkdir() or link() for command ls?
if not, how is ls implemented ?
Here is the source code: http://www.openbsd.org/cgi-bin/cvsweb/src/bin/ls/
 
  


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
implement pipe using C chrislam Programming 3 09-17-2007 09:33 AM
How to implement "more" command? ajaykr Programming 4 05-31-2007 08:24 AM
How to implement ldd command logic nileshbaviskar Programming 2 04-04-2007 02:52 AM
rsync : how to use and implement indiancosmonaut Solaris / OpenSolaris 8 03-04-2007 11:54 PM
Command to Implement new settings w/o re-logging in... rootking Linux - Software 2 06-18-2004 12:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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