![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Type I and Type II Errors - The Heart of Event Processing | iBot | Complex Event Processing RSS News | 0 | 12-05-2007 06:50 PM |
| array type has incomplete element type | jaganadh | High Level Programming | 1 | 07-24-2007 03:54 AM |
| Determining type of file | JWilliams | UNIX for Dummies Questions & Answers | 2 | 04-20-2007 03:14 AM |
| Human readable type vs MIME type detection using file | spauldingsmails | Shell Programming and Scripting | 0 | 03-22-2007 12:43 AM |
| Identify type of file | DebianJ | Shell Programming and Scripting | 1 | 11-17-2005 11:55 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
file type
Hi Everyone!
I am working on a c program which displays all the directories and files under each directory. I want to know what kind of file each is. Like, is the file an ascii text file or english text or a c file. if it is an executable, is it an binary file or a shell script. I was told to look inside the file to achieve this. Is there any unix utility to do this?what function can I use to achive this.Thank you for any kind of help . |
|
||||
|
Thanks
Hi !_30!
Thank you! Ur suggetion was very much helpful. But I just want the message like ascii text or english text.How can I do that? Is the returned value a string or what? Can u give me a more detailed example. ps:Thanks.I think u r really smart.U reply to most of my questions. Thanks anyway. |
|
|||||
|
Like , it was saied , all you can find it's in man file
You can see there a lot of option's .. No the result is not a string , but I can say to you that is inspired from : /usr/share/misc/file/magic.mime If you want just a part of that message to be shown , you can just copy a part of it with ( STRNCPY(string,initial_string+x,y) ) from it .. ![]() |
|
||||
|
Thank you, everyone.
Pardon me for my dumb questions. Can u please tell me whether the filename specified in system("file <file>") should be a constant or can it be a variable too? Because, the file name is in a variable dirt and it changes for every iteration in the loop. Thanks again. |
![]() |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|