[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

File Command Source Code

Hi All,

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

This is urgent

Thanks
Sudhakar
0
sudhakar_koundinya
Asked:
sudhakar_koundinya
4 Solutions
 
sunnycoderCommented:
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
 
sunnycoderCommented:
sudhakar_koundinya,

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

Sunnycoder
0
 
sudhakar_koundinyaAuthor Commented:
>> Hi Dick_A_Barrett??
0
Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

 
sudhakar_koundinyaAuthor Commented:
ok
0
 
sunnycoderCommented:
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
 
sudhakar_koundinyaAuthor Commented:
I understand that ;-)
0
 
sudhakar_koundinyaAuthor Commented:
So whick regular expession do it use to identify text based douments???
0
 
sunnycoderCommented:
I believe it gets the information from the file headers and not regular expressions
0
 
ssnkumarCommented:
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
 
grg99Commented:
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

Featured Post

Easily manage email signatures in Office 365

Managing email signatures in Office 365 can be a challenging task if you don't have the right tool. CodeTwo Email Signatures for Office 365 will help you implement a unified email signature look, no matter what email client is used by users. Test it for free!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now