Tags:
create new tag
, view all tags

Bug: Failed To Create History File For Binary Attachments

On Windows I get the following error:

TWiki . Main . WebHome (oops) Attention

Topic save error During save of file Main an error was found by the version control system. Please notify your TWiki administrator.

Failed to create history file

d:/twikiroot/pub/Main/WebHome/TwikiIndexServerSearchEngineArchitecture.ppt,v

Go back in your browser and save your changes locally.

Topic WebHome . { OK }

Attaching text attachments works fine.

Any clues?

-- MartinCleaver - 02 Nov 2001

This worked just fine for me.

The message looks as if a write permission or something is missing. You should upgrade to the latest production TWiki, it will also give you the full RCS command in the error message, so you can run it from the command line and twiddle with switches.

-- JoachimDurchholz - 23 Nov 2001

Martin, can you verify if this works in the TWikiRelease01Dec2001? Check also the RCS switches for binary files.

-- PeterThoeny - 04 Dec 2001

Due to a quirk of fate (see CoffeeBreak) I no longer work at Andersens so am out of touch with our server there.

I was sent this by one of our developers, he says this makes it work better on Windows. I guess he should be getting the username from the global variable instead of the way he has done it.

Store.pm changes for retrieving old attachment versions


# =========================
sub readAttachmentVersion
{
   #my ( $theWeb, $theTopic, $theAttachment, $theRev ) = @_;
   #my $tmp = $TWiki::revCoCmd;
   #my $fileName = getFileName( $theWeb, $theTopic, $theAttachment, ",v" ); 
   #$tmp =~ s/%FILENAME%/$fileName/;
   #$tmp =~ s/%REVISION%/$theRev/;
   #$tmp =~ /(.*)/;
   #$tmp = $1;       # now safe, so untaint variable
   #my $text = `$tmp`;
   #&TWiki::writeDebug($text);
   #_traceExec( $tmp, $text );
   #return $text;

   # this section has been changed.  instead of trapping STDOUT from the co.exe command,
   # the ,v file is copied to a temporary file (not sure if this is necessary), the required
   # version is extracted to a tempoary file.  This file is then read in and returned instead of
   # STDOUT.

   # This change was made since the STDOUT seems to get corrupted on WIN32 when being returned 
   # by the backquote command. 


   my $userName=&TWiki::Plugins::SiteMinderPlugin::setUpRemoteUser();

   my ( $theWeb, $theTopic, $theAttachment, $theRev ) = @_;
   my $tmp = $TWiki::revCoCmd;
   my $fileName = getFileName( $theWeb, $theTopic, $theAttachment, ",v" );
   my $tmpfileName = getFileName( $theWeb, $theTopic, $theAttachment, ".tmp.$userName,v" );  
   my $newFile = getFileName( $theWeb, $theTopic, $theAttachment, ".tmp.$userName" );
   copy($fileName, $tmpfileName) or warn "copy failed: $!";# copy RCS file to temp file 
   $tmp =~ s/%FILENAME%/$tmpfileName $newFile/;
   $tmp =~ s/%REVISION%/$theRev/;
   $tmp =~ s/-p/-q/; # let's lose -p as it causes output to standard out 
   $tmp =~ /(.*)/;
   $tmp = $1;       # now safe, so untaint variable
   binmode STDOUT, ":raw"; # let's throw this in to be safe 
   system($tmp);

   my $text="";
   my $buf="";
   open ("FILEOUT", "<$newFile");
   binmode("FILEOUT"); 
   while (read("FILEOUT", $buf, 16384)) {$text=$text.$buf;} 
   close "FILEOUT";
   unlink $newFile;
   unlink $tmpfileName;  
   _traceExec( $tmp, $text );
   return $text;

} 
-- MartinCleaver - 17 Dec 2001

Not much can be done with this unless the problem re-emerges.

-- CrawfordCurrie - 14 Feb 2005


Category: TWikiPatches
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2005-02-14 - CrawfordCurrie
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.