File Selection
A File Selection tab holds and compares two lists: Old and New. Use it to compare more than one pair at a time, such as two folders of exports, a handful of objects against their baseline, or any mixture of files, folders and libraries.
Open one with File ▸ New File Selection. For a single pair, New Comparison is quicker and asks for exactly two paths. Ways to open a comparison sets the two beside the other routes, and Two releases of a library walks through one.
Filling the lists
Items reach a list two ways, and only these two:
- Drag them in from Explorer. Whichever list you drop on is the side they land on. Files and folders both.
- Use the tool bar. Old Files and Old Folder fill the Old list, New Files and New Folder the New one, through the standard Windows dialogs. Your favourite folders are down the side of those dialogs.
What a folder stands for
A folder in a list is not compared as a folder: when you press
Compare, it stands for the PowerBuilder objects,
libraries and build files beneath it, to the bottom of the tree.
Exported objects (.sr*), libraries (.pbl,
.pbd), the resource files, workspaces and targets that hold
an application together (see Project and
build files) and the other types pb-diff parses are taken;
everything else in the folder - build output, documents, source
control's own files - is left alone. Name a file directly and it is used
whatever it is called. A workspace is compared as a file; it is not
expanded into the libraries it lists, so add those libraries, or the
folder that holds them, to compare the objects.
A folder holding a whole application holds most objects more than once, and pb-diff takes each once:
- A
.pbdbeside the.pblit was built from is the same library compiled: the.pblis compared and the.pbdleft out. A.pbdon its own is compared. - A compiled object whose source is on the same side is set aside, so the source is compared and the name is not ambiguous.
ws_objects, the copy of the libraries PowerBuilder keeps for source control, is not walked into from a folder above it. Addws_objectsto the lists on its own to compare the exported sources.
The summary's notes say what was left out in each of these ways, so nothing disappears unsaid.
A PowerBuilder 2025 Solution is walked for its sources. Its PBL
folders, such as app.pbl, are ordinary folders holding one
.sr* per object, and the .bin an OLE control
keeps beside its window is taken too, compared as binary. The compiler's
output folders and _BackupFiles are not walked. The
solution and its projects (.pbsln, .pbproj)
are taken as build files, beside the sources; see PowerBuilder 2025 Solutions and Project and build files.
pb-diff then matches the two sides by object name without regard to case, as the Compare Summary describes: a library entry and an exported file of the same object meet, and two inputs on one side that come to the same name are listed apart rather than guessed at.
Nothing you put in a list disappears from the result. The area above the grid names any file that was deleted after you added it and any folder pb-diff could not read to the bottom, usually because you lack access. In either case, the comparison is missing something named by the list.
Rearranging
Select rows in either list and use the tool bar to remove them, or to move them up and down. Swap exchanges the two lists, for when you built them the wrong way round.
Comparing
Compare opens a Compare Summary over the two lists. If each list holds exactly one file, there is nothing to summarise, so the detailed File Compare opens instead. Opening a saved selection with one pair does the same, regardless of how you open it. A folder counts as many, not as one: two folders are always a summary.
The current selection, and saved ones
The lists you build are the current selection. It is remembered as you edit it, so the next time you open a File Selection it is as you left it. Reopen the comparison left open, and the last file selection in Options governs that, and is on by default. Each comparison you start also replaces these lists with what it compared.
File ▸ Save and File ▸ Save As
write the lists to a .pbdiff-sel selection file. From then
on the tab is named after that file and carries an asterisk while it has
unsaved edits. Those edits belong to the file, while the current
selection stays as it was. Comparing a saved selection therefore does
not overwrite what you had built.
File ▸ Open Selection loads a saved selection into
the File Selection tab, opening one if none is open, which is how a tab
becomes a named selection; check it and press Compare.
Dropping one on the File Selection does the same. Double-clicking a
.pbdiff-sel in Explorer, or dropping one anywhere else on
the window, compares it at once. Return to Current
Selection on the tool bar leaves the named file and brings the
current selection back. pb-diff asks before any action that would
discard unsaved edits. This includes returning to the current selection,
opening another selection over this one, closing the tab or closing the
window.
Selection files are JSON: two lists of absolute paths, plus any
renamed pairs you made in a summary. They are readable, diffable and
something a script can write. The legacy .pfs extension is
also accepted wherever a saved selection is named, including the command
line, a drop and the Open Selection dialog, but its contents must use
this JSON format; unrelated binary files are not selection files.
Selection files are associated with pb-diff when the application is
installed, so double-clicking one in Explorer opens pb-diff with that
selection compared; -Mode LoadFile does the same from a
command line.