I suppose there's a drupal page somewhere that explains this, but I can't find it.
When creating a module, you can have files that end with .module, .info, .inc, etc...
What are all the file extensions that are recognized and what do they do?
The extensions that are specific for Drupal, or that have a specific meaning in Drupal, are the following ones:
Third-party modules can use specific extensions, such as the following ones:
A quick googling of 'writing drupal modules' returned the following developer guides:
There is also a project, Examples for Developers, which gives lots of insight into module writing and best practices, etc. It has versions for multiple releases of Drupal as well.
With more respect to .inc files, the documentation for module_load_include() explains how Drupal includes them within modules. Basically they are the Drupal's way of breaking up modules into more manageable pieces. Otherwise, a complex module might have a gigantic .module file.
Also, sometimes modules don't need all of their code loaded; so, code that is only called in certain routines is delegated to a .inc file for performance reasons and loaded only when needed.
If screencasts are more helpful, you might want to check out Your First Module - A Mostly Painless Intro to Drupal Development and click on the screencast link.
Bob over at http://mustardseedmedia.com/podcast has some great podcasts as well; most of his are D6, but he is getting more and more into D7.
.inc
files are php include files, and are not specific to drupal, but to any php environment. a quick grep through any of the .module files will show you what's going on, as will the opening <?php
tag. But these links will show you all the drupal specific files like .module, .info, .install, etc.
Commented
Apr 23, 2012 at 21:39
A module conatins mainly 3 imp files