Reading PowerBuilder libraries
pb-diff opens .pbl and .pbd files, and
libraries appended to a built .exe or .dll,
without PowerBuilder and without ORCA. It works out the flavour from the
file. Unicode libraries (PowerBuilder 10 and later) are what v1
certifies; ANSI libraries (PowerBuilder 5 to 9) are read on a
best-effort basis and are outside the certified scope.
What this is for
Comparing two releases of an application normally starts with
exporting both, which needs a licensed IDE, takes time, and produces
thousands of files nobody wanted. pb-diff reads the library itself: give
the two .pbl files to New
Comparison and the Compare
Summary enumerates their entries and compares them one by one,
exactly as it would compare two folders of exports. The same applies to
a .pbd or to the library inside a shipped
.exe, which is useful when the built application is all you
have.
What is inside a library
Each entry belongs to one of three kinds:
| Kind | What it is | What pb-diff can do with it |
|---|---|---|
| Source | The exportable source of an object: a window, a DataWindow, a function, and so on. | Everything: parse, compare section by section, export as an
importable .sr* file, use as an input to a merge. |
| Compiled | The P-code the IDE generated from that source: .win,
.dwo and the rest. |
Listed, and compared by metadata or by raw bytes. See below. |
| Resource | Bitmaps, icons, cursors and other files bound into the library. | Listed, compared by bytes, and extracted as they are. |
A library also carries metadata of its own: the header comment, the
format version and the creation time. pb-diff-cli info
prints it.
Compiled entries are not decompiled
This is the honest limit of direct library access, and it matters
most when you are comparing .pbd files or a library
extracted from an .exe.
A .pbl normally holds both the source and the compiled
form of each object. In that case nothing is lost: pb-diff compares the
source and you get the usual section-by-section result.
A .pbd, and a library inside a built executable, usually
holds only the compiled form. pb-diff does not interpret P-code
and will not reconstruct source from it. For such an entry you get its
name, type, size and modification time, a comparison of its metadata or
of its raw bytes against the other side, and its raw bytes on request.
You do not get a hierarchy, a script, a line-by-line difference or a
merge. "This object differs" is the most a compiled-only compare can
tell you, and it can occasionally tell you that about an object whose
source never changed, because a recompilation need not be
byte-identical. When you need to know what changed, compare the
.pbl files or the exports.
In a library comparison, a double-click opens a source diff only when both sides have source. A compiled or resource row instead explains that only metadata or byte comparison is available; it does not open binary payloads as PowerScript.
One entry, wherever a file is asked for
Wherever pb-diff asks for a single file you can give one entry of a
library instead. The address is container!entry
(old.pbl!w_main.srw), and it is written the same way in the
New Comparison dialog, on the command line and on the CLI. In New
Comparison you need not type it: the Object… button
beside a path that names a library chooses one; see Select PB Object.
pb-diff-cli compare "old.pbl!w_main.srw" "new.pbl!w_main.srw" --format json
Libraries are read-only
Libraries are opened read-only, always. No workflow in any of the
three executables writes to a .pbl, and there is no setting
that changes that: a merged object leaves as an export file and goes
back in through PowerBuilder's own Import. See How merging works.
What is not a library
Workspace (.pbw) and target (.pbt) files
are not libraries: they name the libraries an application is made of.
pb-diff compares them as files, target by target and library by library
(see Project and build files); to compare
the objects, compare the libraries they list.
In a PowerBuilder 2025 Solution, app.pbl is a folder
holding one UTF-8 source file per object rather than a library file, and
there is nothing in it to open as a library: add the folder to a File
Selection, or open its .sr* files. See PowerBuilder 2025 Solutions.