[ROOT] file copying

From: David R. Relyea (relyea@SLAC.stanford.edu)
Date: Mon Aug 12 2002 - 20:20:26 MEST


I have a simple question, but I can't find reference of it anywhere.  I
want to copy a file from one spot to another, and then access the new
file.  My problem is that if I do

(this is all compiled code, btw)
  gSystem->Exec("cp file1 file2");
  TFile *f1 = new TFile("file2","READ");

, ROOT attempts to open the file before it's fully copied (the files are
100 Mb and contain ~100 branches, so they take a while to copy).  I could
create another TFile and use ROOT to copy the file over that way, but that
seems like it would be much slower than the straight system call to "cp".
So how do I wait for the file to fully copy before I read it?  Or should I
use TFile::Copy?

David Relyea



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:04 MET