473,434 Members | 1,494 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

Code

Hi all,
May i want c coding for ls command did any one help?.
Thanks in advanced.

Apr 26 '06 #1
7 2225

Sabari schrieb:
Hi all,
May i want c coding for ls command did any one help?.
Thanks in advanced.


Could you be more precise?

Apr 26 '06 #2

Sabari wrote:
Hi all,
May i want c coding for ls command did any one help?.
Thanks in advanced.


Please read the manual pages for the opendir() and readdir().
You can use these functions for a simple implementation of the ls
command.

Apr 26 '06 #3

Sabari wrote:
May i want c coding for ls command did any one help?.


I asume you mean:

"If I wanted to implement the (*nix) `ls` command,
can anyone help?"

I'd suggest you look into any of the numerous Linux distributions
(*BSD, and Open Solaris may help as well). They should all provide the
source for theirs.

Apr 26 '06 #4
In article <11*********************@t31g2000cwb.googlegroups. com>, Zero
<ch********@web.de> writes

Sabari schrieb:
Hi all,
May i want c coding for ls command did any one help?.
Thanks in advanced.


Could you be more precise?


He was. He wants the source code for the unix ls command. It is probably
part of Linux or Free BSD

In any event he is inthe wrong NG
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Apr 26 '06 #5
arun wrote:
Sabari wrote:
Hi all,
May i want c coding for ls command did any one help?.
Thanks in advanced.


Please read the manual pages for the opendir() and readdir().
You can use these functions for a simple implementation of the ls
command.


opendir and readdir are not Standard C functions and are thus off-topic
here. Since most implementations of ls (including are those conforming
to POSIX) perform significantly more operations than can be
accomplished with these two functions and the OP didn't ask about
implementing a specific part of the command I doubt your suggestion
would be of much use, even if it was on-topic.

Robert Gamble

Apr 26 '06 #6

Robert Gamble wrote:
arun wrote:
Sabari wrote:
Hi all,
May i want c coding for ls command did any one help?.
Thanks in advanced.


Please read the manual pages for the opendir() and readdir().
You can use these functions for a simple implementation of the ls
command.


opendir and readdir are not Standard C functions and are thus off-topic
here. Since most implementations of ls (including are those conforming
to POSIX) perform significantly more operations than can be
accomplished with these two functions and the OP didn't ask about
implementing a specific part of the command I doubt your suggestion
would be of much use, even if it was on-topic.

Robert Gamble


I dont think we can use only standard C functions for implementing a
command like ls.
And i dont know whether there is any standard C function for reading
directories and inode details. I thought a simple implementation of ls
can be using opendir() and readdir(). Of course they are not going to
give you all the informations provided by ls. But still you can get the
directory entries and you can use functions like stat to get more
details.
But this of course is not the real implementation for ls.
I dont know the purpose of the code sabari asked for. If you want to
get the real thing you can read the ls source code that comes with any
free unix distro. I had read the source code that came with redhat
linux. It was having about 4000 lines of code.

Regards,
arun..

Apr 26 '06 #7
arun wrote:
Robert Gamble wrote:
arun wrote:
Sabari wrote:
> Hi all,
> May i want c coding for ls command did any one help?.
> Thanks in advanced.

Please read the manual pages for the opendir() and readdir().
You can use these functions for a simple implementation of the ls
command.


opendir and readdir are not Standard C functions and are thus off-topic
here. Since most implementations of ls (including are those conforming
to POSIX) perform significantly more operations than can be
accomplished with these two functions and the OP didn't ask about
implementing a specific part of the command I doubt your suggestion
would be of much use, even if it was on-topic.

Robert Gamble


I dont think we can use only standard C functions for implementing a
command like ls.


No, you can't, which is why it is off-topic here. comp.unix.programmer
would be a much better place to discuss this further.

Robert Gamble

Apr 26 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

51
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
9
by: bigoxygen | last post by:
Hi. I'm using a 3 tier FrontController Design for my web application right now. The problem is that I'm finding to have to duplicate a lot of code for similar functions; for example, listing...
4
by: jason | last post by:
Hello. Newbie on SQL and suffering through this. I have two tables created as such: drop table table1; go drop table table2; go
16
by: Dario de Judicibus | last post by:
I'm getting crazy. Look at this code: #include <string.h> #include <stdio.h> #include <iostream.h> using namespace std ; char ini_code = {0xFF, 0xFE} ; char line_sep = {0x20, 0x28} ;
109
by: Andrew Thompson | last post by:
It seems most people get there JS off web sites, which is entirely logical. But it is also a great pity since most of that code is of such poor quality. I was looking through the JS FAQ for any...
5
by: ED | last post by:
I currently have vba code that ranks employees based on their average job time ordered by their region, zone, and job code. I currently have vba code that will cycle through a query and ranks each...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Today we are going to look at Code Access Security. Code access security is a feature of .NET that manages code depending on its trust level. If the CLS trusts the code enough to...
18
by: Joe Fallon | last post by:
I have some complex logic which is fairly simply to build up into a string. I needed a way to Eval this string and return a Boolean result. This code works fine to achieve that goal. My...
37
by: Alan Silver | last post by:
Hello, Newbie here, so please forgive what is probably a basic question ... I see a lot of discussion about "code behind", which if I have understood correctly, means that the script code goes...
171
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles)...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.