File extensions

From Free Pascal wiki
Jump to navigationJump to search

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).


Project files

extension description help format
.lpg Lazarus Project Group file Project Groups XML
.lpk Lazarus Package file (contains package-specific settings) Lazarus Packages XML
.lpi Lazarus Project Information file (contains project-specific settings) XML
.lps Lazarus Project Session file Project Options XML
.lpr Lazarus Program file, contains Pascal source of main program pascal
.lfm 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. text
.pas Unit with Pascal code. It may also contain the code of form (stored in the LFM-file of the same name). pascal
.pp Pascal code pascal
.inc 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. $include pascal
.compiled Compilation session for a project XML
.ppu Unit description file. Not to be confused with the compiled unit, which has the extension ".o" [1] binary
.o Compiled unit. Is the result of compilation by FPC (Free Pascal) or any other compiler (e.g. GCC for C++). binary
.or Object resource, automatically generated from {$R} directive binary
.a (1) Compiled unit, code part for smartlinking (on some platforms)
(2) Compiled code from other compilers (e.g. gcc) linked into a static library
.lrs Lazarus Resource file (this is a generated file; not to be confused with a Windows resource file) Lazarus Resources text
.lrt Lazarus Resource string Table created when saving a LFM-file and i18n is enabled. It contains the TTranslateString properties of the LFM-file.
.rst Resource String Table created by the compiler for every unit with a "resourcestring" section Getting translation strings right text
.rsj Resource String table in JSON format created by FPC 2.7.1 for units with "resourcestring" section Using resourcestrings, [2] JSON
.rc Resource script Lazarus Resources text
.res Compiled resource Lazarus Resources binary
.ico Icon (typically for a program) ico
.gitignore Ignore list of git text

Subversion or Git

These files would normally be stored in a repository as an adequate description of a project:


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:


These files are regenerated by the IDE or by a build so do not need to be stored:


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].


Project files

   Delphi form module
   Delphi project options file
   Desktop configuration

Converting Delphi projects

Lazarus can convert at least some Delphi project files into its own format.



   Text file
   Gettext Portable Object
   Config file
   Compiled Help File - contains html. See also package chm
   Comma Separated Values text file format 
   Directly executable program
   Help file
   Initialization file
   OpenDocument text document
   Portable Document Format
   Rich Text Format text file


   Portable network graphic
   portable pixmap 
   portable graymap 
   portable bitmap 
   compressed image format standardised by the Joint Photographic Experts Group (JPEG)




   Hypertext Markup Language
   Cascading style sheet


   tape archive
   a single file containing one or more compressed files


   Database file
   Multiple index file


*.ods Calc spreadsheet File Format
   Microsoft Excel File Format
   Microsoft Office Open XML Excel File Format 

Operating system

Linux and Unix (excluding Darwin)

   Shared object library
   Shell script
   Debian Package
   Red Hat Package Manager

Mac (Darwin)

   Application bundle (a structured directory)
   Disk Image File 
   Dynamic shared library
   Framework (set of interfaces or subframeworks)
   Icon resource file containing one or more images used for an application icon 
   Property list file (storage for serialised objects)


   Batch file. It's a text file that contains a sequence of commands for a computer operating system.
  dynamic-link library
   Directly executable program

See also

Alphabetical list of file extensions