Что такое формат файла P?
A .p file is a Pascal source code file - plain human-readable text written in the Pascal programming language. The extension was used by early Unix Pascal compilers, most notably Berkeley Pascal (pc), and by classic Macintosh Pascal environments, where .p was the default extension for program sources.
Inside the file you will find standard Pascal constructs: a program or unit header, a uses clause listing library dependencies, const, type, and var declaration blocks, and one or more procedure or function definitions, all ending with a begin...end. main block. Comments use curly-brace { } or parenthesis-star (* *) delimiters.
Today, .p files are compiled primarily with Free Pascal (fpc) or its Lazarus IDE, though legacy code may target GNU Pascal (gpc). Any plain-text editor opens .p files for reading and editing; Visual Studio Code with a Pascal extension provides syntax highlighting and basic language support.
.p is one of several Pascal source extensions. The dominant modern choice is .pas; Free Pascal also uses .pp; Delphi project files use .dpr. Compiled output typically produces an .o object file as an intermediate step before linking. Note that .p is also used by Progress OpenEdge ABL for procedure files, so the surrounding toolchain should be checked when the format is ambiguous.
- Pascal dialects handled: Standard/ISO Pascal, Turbo/Borland Pascal, Object Pascal, Free Pascal
- Compiled with
fpcon all major platforms or legacygpcon Unix/Linux - No binary content - pure ASCII or UTF-8 plain text throughout
Безопасность и защита
РИСК: LOWA .p Pascal source file is plain text and does nothing until you COMPILE and run it - so simply opening one to read is safe. The risk is the same as any source code: it could contain malicious logic, so review code from untrusted sources before compiling/executing the resulting program. Be sure you've correctly identified the file as Pascal (vs a Progress 4GL .p) before trying to build it.
Детали формата
в двух словах- Progress OpenEdge ABL (4GL) procedure - Progress/OpenEdge business-application source ('.p' procedure files), edited/run in the OpenEdge AppBuilder/PDS - unrelated to Pascal.
- GNU gettext / Perl source (rare) - Occasionally seen for Perl scripts or other source; context-dependent and uncommon.
Программы, открывающие файлы P
Технические подробности
глубокая спецификация| MIME type | text/x-pascal |
| Encoding | ASCII or UTF-8 plain text; no BOM required |
| File structure | Pascal program/unit header → uses clause → const/type/var declarations → procedures/functions → begin…end. main block |
| Comment syntax | Curly-brace { } or parenthesis-star (* *) delimiters; single-line // supported in Free Pascal and Delphi mode |
| File identification | No magic bytes - identified by Pascal keywords such as program, unit, begin, end, var, procedure, function |
| Typical file size | A few hundred bytes to tens of KB per source module |
| Supported Pascal dialects | Standard/ISO Pascal, Turbo/Borland Pascal, Object Pascal, Free Pascal 3.2.x |
| Primary compiler | Free Pascal (fpc); historically Berkeley Pascal (pc) on Unix, GNU Pascal (gpc) on Linux |
| Compilation output | Intermediate .o object file linked into a native binary executable |
| Platform support | Cross-platform source - Windows, macOS, Linux, Unix |
| Historical origin | Extension adopted by Berkeley Pascal on Unix and classic Macintosh Pascal; .pas later became the mainstream Pascal extension |
| Related source extensions | .pas (dominant), .pp (Free Pascal), .dpr (Delphi project), .lpr (Lazarus project) |
| IDE support | Lazarus IDE (Free Pascal's GUI front-end) recognizes and compiles .p alongside .pas sources |
| Syntax paradigm | Algol-derived structured programming; begin…end pairs delimit all compound statements and the program body |
| Ambiguity note | .p is also used by Progress OpenEdge ABL for 4GL procedure files - the file's opening keyword (program/unit vs ABL-specific syntax) distinguishes the two |
| Выпущен | 1970 (Pascal language; .p used by various Unix/Mac Pascal compilers) |
| Последняя версия | N/A (source text; tracks the Pascal dialect/compiler, e.g. Free Pascal 3.2.x / Object Pascal) |
| Открыть стандартное | Да · без роялти |
| Спецификация | www.freepascal.org |
Конвертации P
Вопросы и ответы сообщества
спрошено пользователямиВопросов пока нет - станьте первым, кто спросит о файлах P.