Revision 1 of 4, by N7800 on 12-8-2023. The page as it is now.
File extensions
Here are the file extensions that are used when developing programs in Pascal. In most cases, these are extensions used by the IDE (Lazarus) and the compiler (FPC).
Lazarus
Project files
<table> <thead> <tr> <th>extension</th> <th>description</th> <th>help</th> <th>format</th> </tr> </thead> <tbody> <tr> <td>.lpg</td> <td>Lazarus Project Group file</td> <td>Project Groups</td> <td>XML</td> </tr> <tr> <td>.lpk</td> <td>Lazarus Package file (contains package-specific settings)</td> <td>Lazarus Packages</td> <td>XML</td> </tr> <tr> <td>.lpi</td> <td>Lazarus Project Information file (contains project-specific settings)</td> <td></td> <td>XML</td> </tr> <tr> <td>.lps</td> <td>Lazarus Project Session file</td> <td>Project Options</td> <td>XML</td> </tr> <tr> <td>.lpr</td> <td>Lazarus Program file, contains Pascal source of main program</td> <td></td> <td>pascal</td> </tr> <tr> <td>.lfm</td> <td>Lazarus Form file - contains all components and their properties. The source code of the form is located in the PAS-file of the same name.</td> <td></td> <td>text</td> </tr> <tr> <td>.pas</td> <td>Unit with Pascal code. It may also contain the code of form (stored in the LFM-file of the same name).</td> <td></td> <td>pascal</td> </tr> <tr> <td>.pp</td> <td>Pascal code</td> <td></td> <td>pascal</td> </tr> <tr> <td>.inc</td> <td>Include file. Contains a part of Pascal code that can be "included" in the program by the {$i} directive. Not to be confused with INC-files of other programming languages that use the same extension.</td> <td>$include</td> <td>pascal</td> </tr> <tr> <td>.compiled</td> <td>Compilation session for a project</td> <td></td> <td>XML</td> </tr> <tr> <td>.ppu</td> <td>Unit description file. Not to be confused with the compiled unit, which has the extension ".o"</td> <td><a href="https://www.freepascal.org/docs-html/prog/progse65.html">1</a></td> <td>binary</td> </tr> <tr> <td>.o</td> <td>Compiled unit. Is the result of compilation by FPC (Free Pascal) or any other compiler (e.g. GCC for C++).</td> <td></td> <td>binary</td> </tr> <tr> <td>.or</td> <td>Object resource, automatically generated from {$R} directive</td> <td></td> <td>binary</td> </tr> <tr> <td>.a</td> <td>(1) Compiled unit, code part for smartlinking (on some platforms)<br /> (2) Compiled code from other compilers (e.g. gcc) linked into a static library</td> <td></td> <td>binary</td> </tr> <tr> <td>.lrs</td> <td>Lazarus Resource file (this is a generated file; not to be confused with a Windows resource file)</td> <td>Lazarus Resources</td> <td>text</td> </tr> <tr> <td>.lrt</td> <td>Lazarus Resource string Table created when saving a LFM-file and i18n is enabled. It contains the TTranslateString properties of the LFM-file.</td> <td></td> <td></td> </tr> <tr> <td>.rst</td> <td>Resource String Table created by the compiler for every unit with a "resourcestring" section</td> <td>Getting translation strings right</td> <td>text</td> </tr> <tr> <td>.rsj</td> <td>Resource String table in JSON format created by FPC 2.7.1 for units with "resourcestring" section</td> <td>Using resourcestrings, <a href="https://www.freepascal.org/docs-html/prog/progse39.html">2</a></td> <td>JSON</td> </tr> <tr> <td>.rc</td> <td>Resource script</td> <td>Lazarus Resources</td> <td>text</td> </tr> <tr> <td>.res</td> <td>Compiled resource</td> <td>Lazarus Resources</td> <td>binary</td> </tr> <tr> <td>.ico</td> <td>Icon (typically for a program)</td> <td></td> <td>ico</td> </tr> <tr> <td>.gitignore</td> <td>Ignore list of git</td> <td></td> <td>text</td> </tr> </tbody> </table>
Subversion or Git
These files would normally be stored in a repository as an adequate description of a project:
*.lpi
*.lpr
*.lfm
*.pas
*.pp
These files might contain manually-generated or imported information, or might be regenerated by the IDE or build process. In general, if they have the same basename as the project or a form or unit they're IDE-generated, but in all cases should be reviewed individually:
*.inc
*.res
*.lrs
*.rc
*.ico
These files are regenerated by the IDE or by a build so do not need to be stored:
*.ppu
*.o
*.a
*.lps
*.or
*.rst
*.compiled
Note that *.lrj files are generated for every form while tracking i18n, loss of these files can cause missing translations.
There is an example .gitignore file at 3.
Delphi
Project files
*.dfm
Delphi form module
*.dof
Delphi project options file
*.dsk
Desktop configuration
Converting Delphi projects
Lazarus can convert at least some Delphi project files into its own format.
Application
General
*.txt
Text file
*.po
Gettext Portable Object
*.bak
Backup
*.cfg
Config file
*.chm
Compiled Help File - contains html. See also package chm
*.csv
Comma Separated Values text file format
*.exe
Directly executable program
*.hlp
Help file
*.ini
Initialization file
*.odt
OpenDocument text document
*.pdf
Portable Document Format
*.ps
PostScript
*.rtf
Rich Text Format text file
Image
*.png
Portable network graphic
*.bmp
bitmap
*.ico
icon
*.xpm
pixmap
*.ppm
portable pixmap
*.pgm
portable graymap
*.pbm
portable bitmap
*.jpg
compressed image format standardised by the Joint Photographic Experts Group (JPEG)
XML
*.xml
*.dtd
*.xsd
*.xsl
Web
*.html
Hypertext Markup Language
*.css
Cascading style sheet
Archive
*.tar
tape archive
*.zip
a single file containing one or more compressed files
Database
*.dbf
Database file
*.mdx
Multiple index file
Spreadsheet
*.ods
OpenOffice.org Calc spreadsheet File Format
*.xls
Microsoft Excel File Format
*.xlsx
Microsoft Office Open XML Excel File Format
Operating system
Linux and Unix (excluding Darwin)
*.so
Shared object library
*.sh
Shell script
*.deb
Debian Package
*.rpm
Red Hat Package Manager
Mac (Darwin)
*.app
Application bundle (a structured directory)
*.dmg
Disk Image File
*.dylib
Dynamic shared library
*.framework
Framework (set of interfaces or subframeworks)
*.icns
Icon resource file containing one or more images used for an application icon
*.plist
Property list file (storage for serialised objects)
Windows
*.bat
Batch file. It's a text file that contains a sequence of commands for a computer operating system.
*.dll
dynamic-link library
*.exe
Directly executable program
See also
Alphabetical list of file extensions
From the Free Pascal wiki, page "File extensions", as it stood on 2023-12-08 after a change by N7800, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.
