LinuxQuestions.org
Visit the LQ Articles and Editorials section
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: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
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: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
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
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,301

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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
Distribution: OpenBSD, Redhat, OpenSUSE
Posts: 7

Rep: Reputation: 0
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


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
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


All times are GMT -5. The time now is 01:57 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration