TWS file format

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
IanOfYork
Posts: 116
Joined: Sat Nov 04, 2017 11:54 am
Location: York, England

TWS file format

Post by IanOfYork »

Please consider converting the workspace control files to an open format.
Either change the format to XML, publish the file spec or provide a utility to list the embedded information.
An XML format would allow us to edit the file list when a directory is renamed.
User avatar
bbadmin
Site Admin
Posts: 863
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Re: TWS file format

Post by bbadmin »

TextPad's workspace files are saved in the most compact and fastest format possible.

The path to document file names is stored relative to the folder containing the WSP file (unless they are above it or in a different path). Hence, you can move the whole directory tree to another location and the files in the workspace can still be opened.

If you use the File/Rename command to move a file to a new location, that change will be saved in the workspace.

Unfortunately, this does not help if you rename a directory or file outside of TextPad.
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Re: TWS file format

Post by ben_josephs »

I posted a Python script that lists the names of the document files in a workspace file here:
viewtopic.php?p=45822#p45822
IanOfYork
Posts: 116
Joined: Sat Nov 04, 2017 11:54 am
Location: York, England

Re: TWS file format

Post by IanOfYork »

You did indeed, for which I thank you.
I also have a (rather less concise) PHP script that I used to study the TWS format and which can also output the file list.

I am just thinking that it would be nicer if the TWS file was editable.

If I rename a project that is referenced in one or more TWS files, then loading one of those TWS files causes TextPad to silently remove the (now invalid) references.

Perhaps a "cheaper" option would be a once-only (copyable) message that lists the "lost" files.
User avatar
bbadmin
Site Admin
Posts: 863
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Re: TWS file format

Post by bbadmin »

Not directly applicable, but in case you're not aware, the Edit/Copy Other/All File Names command will place the fully qualified names of all the files currently open on the clipboard.

Also, if you paste and save them in a file, say wspfiles.txt, then use the Quick Open command (Ctrl+Shift+O) to open it as "@wspfiles.txt", all the files in it will be opened instead. You can also use an @-file as a runtime parameter when starting TextPad.
Post Reply