Difference between revisions of "File extensions"

From Lazarus wiki
Jump to navigationJump to search
(Page description clarified)
 
(15 intermediate revisions by 5 users not shown)
Line 1: Line 1:
File extensions
+
Here are the [[File extension|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).
 
 
Some [[File extension|file extensions]]
 
  
 
== Lazarus ==
 
== Lazarus ==
 
=== Project files ===
 
=== Project files ===
 
{| class="wikitable sortable"  
 
{| class="wikitable sortable"  
! extension || description  
+
! extension || description || help || format
 
|-
 
|-
| .lpi  || Lazarus Project Information file (stored in XML; contains project-specific settings)
+
| .lpg || Lazarus Project Group file || [[Project_Groups|Project Groups]] || XML
 
|-
 
|-
| .lpr  || Lazarus Program file; contains Pascal source of main program
+
| .lpk || Lazarus Package file (contains package-specific settings) || [[Lazarus_Packages|Lazarus Packages]] || XML
 
|-
 
|-
| .lfm  || Lazarus Form file; contains configuration information for all objects on a form (stored in a Lazarus-specific format; the actions are described by Pascal source code in a corresponding *.pas file)  
+
| .lpi || Lazarus Project Information file (contains project-specific settings) || || XML
 
|-
 
|-
| .pas  || Unit with Pascal code (typically for a form stored in a corresponding *.lfm file)
+
| .lps || Lazarus Project Session file || [[IDE Window: Project Options#Save session information in|Project Options]] || XML
 
|-
 
|-
| .pp || Pascal code
+
| .lpr || Lazarus Program file, contains Pascal source of main program || || pascal
 
|-
 
|-
| .lrs  || Lazarus Resource file (this is a generated file; not to be confused with a Windows resource file).  
+
| .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
 
|-
 
|-
| .ppu  || Compiled unit, symbols part.
+
| .pas || Unit with Pascal code. It may also contain the code of form (stored in the LFM-file of the same name). || || pascal
 
|-
 
|-
| .|| (1) Compiled unit, code part.<br />  (2) Compiled code from other compilers (e.g. gcc)
+
| .pp || Pascal code || || pascal
 
|-
 
|-
| .or || object resource, automatically generated from {$R} directive.
+
| .inc || Include file. Contains a part of Pascal code that can be "included" in the program by the [[$include|{$i} directive]]. Not to be confused with INC-files of other programming languages that use the same extension. || [[$include]] || pascal
 
|-
 
|-
| .|| (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
+
| .compiled || Compilation session for a project || || XML
 
|-
 
|-
| .lpk  || Lazarus package information file. (stored in XML; contains package-specific settings)
+
| .ppu || Unit description file. Not to be confused with the compiled unit, which has the extension ".o" || [https://www.freepascal.org/docs-html/prog/progse65.html] || binary
 
|-
 
|-
| .inc || Include file
+
| .o || Compiled unit. Is the result of compilation by FPC (Free Pascal) or any other compiler (e.g. GCC for C++). || || binary
 
|-
 
|-
| .lps || Lazarus Project Session file. See [[IDE Window: Project Options#Save session information in|Project Options -> Save session information in]]
+
| .or || Object resource, automatically generated from {$R} directive || || binary
 
|-
 
|-
| .lrt || Lazarus Resourcestring table created when saving a lfm file and i18n is enabled. It contains the TTranslateString properties of the lfm.
+
| .a || (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 || || binary
 
|-
 
|-
| .rst || Resourcestring table created by the compiler for every unit with a resourcestring section.
+
| .lrs || Lazarus Resource file (this is a generated file; not to be confused with a Windows resource file) || [[Lazarus_Resources|Lazarus Resources]] || text
 
|-
 
|-
| .rsj || Resourcestring table in JSON format created by FPC 2.7.1 for units with resourcestring section.
+
| .lrt || Lazarus Resource string Table created when saving a LFM-file and i18n is enabled. It contains the TTranslateString properties of the LFM-file. || ||
 
|-
 
|-
| .compiled || compilation session for a project
+
| .rst || Resource String Table created by the compiler for every unit with a "resourcestring" section || [[Getting_translation_strings_right|Getting translation strings right]] || text
 
|-
 
|-
| .ico || program icon
+
| .rsj || Resource String table in JSON format created by FPC 2.7.1 for units with "resourcestring" section || [[Using_resourcestrings|Using resourcestrings]], [https://www.freepascal.org/docs-html/prog/progse39.html] || JSON
 +
|-
 +
| .rc || Resource script || [[Lazarus_Resources|Lazarus Resources]] || text
 +
|-
 +
| .res || Compiled resource || [[Lazarus_Resources|Lazarus Resources]] || binary
 
|-  
 
|-  
| .gitignore || list of files/directories to be ignored when using [[git]]
+
| .ico || Icon (typically for a program) || || ico
 
|-
 
|-
| .res || compiled [[resource file]]
+
| .gitignore || Ignore list of [[git]] || || text
 
|}
 
|}
 
  
 
=== Subversion or Git ===
 
=== Subversion or Git ===
Line 76: Line 77:
 
  *.rst
 
  *.rst
 
  *.compiled
 
  *.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 [https://github.com/github/gitignore/blob/master/Global/Lazarus.gitignore].
 
There is an example .gitignore file at [https://github.com/github/gitignore/blob/master/Global/Lazarus.gitignore].
Line 136: Line 139:
 
     portable bitmap  
 
     portable bitmap  
 
  *.jpg
 
  *.jpg
 
+
    compressed image format standardised by the Joint Photographic Experts Group (JPEG)
 
 
  
 
=== XML ===
 
=== XML ===
Line 155: Line 157:
 
     tape archive
 
     tape archive
 
  *.zip
 
  *.zip
 +
    a single file containing one or more compressed files
  
 
=== Database ===
 
=== Database ===
Line 171: Line 174:
  
 
== Operating system ==
 
== Operating system ==
=== Linux and Unix ===
+
=== Linux and Unix (excluding Darwin) ===
 
  *.so  
 
  *.so  
 
     Shared object library
 
     Shared object library
Line 179: Line 182:
 
     Debian Package
 
     Debian Package
 
  *.rpm
 
  *.rpm
     Red Hat Package Manager  
+
     Red Hat Package Manager
 +
 
 +
===  Mac (Darwin) ===
  
===  Mac ===
 
 
  *.app
 
  *.app
     Application bundle
+
     [[Application Bundle|Application bundle]] (a structured directory)
 
  *.dmg
 
  *.dmg
 
     Disk Image File  
 
     Disk Image File  
 
  *.dylib  
 
  *.dylib  
     Dynamic shared library
+
     [[macOS Dynamic Libraries|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
 +
    [[macOS property list files|Property list file]] (storage for serialised objects)
  
 
=== Windows ===
 
=== Windows ===
Line 198: Line 208:
  
 
== See also ==
 
== See also ==
 +
 
[[Alphabetical list of file extensions]]
 
[[Alphabetical list of file extensions]]
  
 +
[[Category:Lazarus]]
 
[[Category:File Handling]]
 
[[Category:File Handling]]

Latest revision as of 15:30, 8 December 2023

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

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
binary
.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:

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