Solved

File Command  Source Code

Posted on 2004-07-29
11
253 Views
Last Modified: 2006-11-17
Hi All,

Can any body give me the link to the Linux File Command  Source code??

This is urgent

Thanks
Sudhakar
0
Comment
Question by:sudhakar_koundinya
11 Comments
 
LVL 45

Accepted Solution

by:
sunnycoder earned 100 total points
Comment Utility
Hi Dick_A_Barrett,

http://rpmfind.net/linux/rpm2html/search.php?query=file

download a .src rpm for your distro from the above link

Sunnycoder
0
 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
sudhakar_koundinya,

Sorry, I got the name wrong ... QP messed up

Sunnycoder
0
 
LVL 14

Author Comment

by:sudhakar_koundinya
Comment Utility
>> Hi Dick_A_Barrett??
0
 
LVL 14

Author Comment

by:sudhakar_koundinya
Comment Utility
ok
0
 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
Got the name from another question asker... The link is still valid :o) ... you should be able to get source code from the link
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 14

Author Comment

by:sudhakar_koundinya
Comment Utility
I understand that ;-)
0
 
LVL 14

Author Comment

by:sudhakar_koundinya
Comment Utility
So whick regular expession do it use to identify text based douments???
0
 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
I believe it gets the information from the file headers and not regular expressions
0
 
LVL 8

Assisted Solution

by:ssnkumar
ssnkumar earned 30 total points
Comment Utility
If you have a linux box, then the source code will be bundled in the same!
The path will be: /usr/src/linux/

-ssnkumar
0
 
LVL 22

Assisted Solution

by:grg99
grg99 earned 20 total points
Comment Utility
Oh, sigh, the "file" command .....

Unix doesnt have any file signatures, so the dang foolish "file" command has to poke thru the file and make an estimated wildass guess.

For plain ASCII text files, not Unicode, a good guess would be:  It's a text file if 9X% of the characters are in the range 32..127, plus CR, LF, TAB.  That allows for the occasional Norwegian umlaut and such.  Might also check to see if lines are reasonable lengths, i.e. there's a CR-LF (for DOS) or just LF every 1 to 140 bytes or so.  You could also see if words are a reasonable length, i.e. average run between whitespace is between 4 and 15 or so.


If you want to guess the programming language, it gets a lot harder, as C, C++, csh, and Perl don't look all that different, except to a pretty good parser.  You could do some dumb heuristics, like if there's a few #include's, it's probably C or C++, if there's any "class", most likely C++, if there's lots of dollar-signs, maybe Perl.




0
 
LVL 23

Assisted Solution

by:Mysidia
Mysidia earned 100 total points
Comment Utility
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now