Invalid Workspace Archive
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Invalid Workspace Archive
I have been encountering this from time to time since upgrading to TP 7.1.0
I get the error message when opening a Workspace file (*.tws), and the Workspace gets trashed.
I get the error message when opening a Workspace file (*.tws), and the Workspace gets trashed.
(2[Bb]|[^2].|.[^Bb])
That is the question.
That is the question.
OK, I may have figured out the pattern.
It appears that if one has a Workspace with a file open in it, and the file gets moved to a different folder, either when TP closes, or when TP opens again, the Workspace becomes invalid because it has a link to a file which no longer exists.
It appears that if one has a Workspace with a file open in it, and the file gets moved to a different folder, either when TP closes, or when TP opens again, the Workspace becomes invalid because it has a link to a file which no longer exists.
(2[Bb]|[^2].|.[^Bb])
That is the question.
That is the question.
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
I believe this happened to me once with TextPad 7, although I haven't been able to reproduce it.
I have a Perl script that lists the file names in a TextPad workspace file. I keep my large and growing collection of workspace files in a single directory, and I use this script to find out in which workspace I long ago edited some particular half-forgotten file. Might it be useful to you (or anyone else)?
I have a Perl script that lists the file names in a TextPad workspace file. I keep my large and growing collection of workspace files in a single directory, and I use this script to find out in which workspace I long ago edited some particular half-forgotten file. Might it be useful to you (or anyone else)?
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
The script twsfiles.pl below assumes that your workspaces are in the directory C:/t .
To list all the files in workspace aWorkspace enter
perl twsfiles.pl aWorkspace.tws
To list all the files in all workspaces matching wildcard expression wildcard_expression enter
perl twsfiles.pl wildcard_expression
To list all the files in all workspaces enter
perl twsfiles.pl
To list all the files in workspace aWorkspace enter
perl twsfiles.pl aWorkspace.tws
To list all the files in all workspaces matching wildcard expression wildcard_expression enter
perl twsfiles.pl wildcard_expression
To list all the files in all workspaces enter
perl twsfiles.pl
Code: Select all
use warnings ;
use strict ;
use Encode ;
use File::Glob ':glob' ;
my $twsDir = 'C:/t' ;
chdir $twsDir or
die "Can't change to directory \"$twsDir\": $!\n" ;
my @twsNames = map { bsd_glob $_ } ( @ARGV ? @ARGV : ( '*.tws' ) ) ;
for my $twsName ( @twsNames )
{
if ( -f $twsName && $twsName =~ /\.tws$/ )
{
print "\n$twsName\n" ;
if ( open TWS, $twsName )
{
local $/ = undef ;
my $tws = <TWS> ;
close TWS ;
if ( ( ord substr $tws, 2, 1 ) >= 7 ) # new-style (UTF-16) workspace file
{
my @docNames = $tws =~ /[EB]COD.{5}((?:..)+?)\x00\x00/gs ;
for my $docName ( sort @docNames )
{
print +( decode 'ucs-2le', $docName ), "\n" ;
}
}
else # old-style (ASCII) workspace file
{
my @docNames = $tws =~ /[EB]COD..(.+?)\x00/gs ;
for my $docName ( sort @docNames )
{
print "$docName\n" ;
}
}
}
else
{
warn "Can't open \"$twsName\".\n" ;
}
}
elsif ( -f $twsName )
{
print "\n\"$twsName\" is not a workspace file.\n" ;
}
else
{
print "\n\"$twsName\" doesn't exist.\n" ;
}
}