Find file type txt jpg also system events

HAI!

Before you tell me "GOOGLE IT"..
I will say that I can't go on google on this network.. I know it's awful.

I am creating a file/desktop manager for Linux.
I have a code block to get the file extension.
BUT! How would I find a file TYPE?
For instance in nautilus, you can take the extention away from a jpeg.. and it will still recognize it as a jpeg.


also..

I know for w!nd0ws there are system events (if a file is created, for example)
Is there anything like this in Linux?

KTHXBYE!
2 possibilities: Either a file contains metadata describing it's type, or you can try to make a guess at the file type from the file's content. I say guess because with binary data it can happen through coincidence that the representation of one type would also be valid for another type.
true. thanks! and for the second question i think ill use inotify
GOOGLE IT!

YAHOO IT!

ASK IT!

PROXY IT!


...
Topic archived. No new replies allowed.