{
<< f << "," << desc << ")"
ptr = 0;
fd = -1;
opt = "READ";
opt = "NEW";
opt = "RECREATE";
opt = "UPDATE";
} else {
return 1;
}
TFile *tf(0);
if (
n.find(
"https://") != std::string::npos ||
n.find(
"HTTPS://") != std::string::npos ||
n.find(
"http://") != std::string::npos ||
n.find(
"HTTP://") != std::string::npos ) {
<< "requested mode is: " << f
return 1;
}
if (!
m_ssl_setup && (
n.find(
"https://") != std::string::npos ||
n.find(
"HTTPS://") != std::string::npos )) {
<< "Unable to setup TSSLSocket for ROOT TWebFile access over https"
}
}
try {
tf =
new TWebFile(
n.c_str());
} catch (const std::exception& Exception) {
<< " file for reading: " << Exception.what() << std::endl
<<
" -> file probably corrupt." <<
endmsg;
return 1;
} catch (...) {
<<
"\": probably corrupt" <<
endmsg;
return 1;
}
if (tf != 0 && tf->IsZombie()) {
<<
"\": file does not exist or in not accessible" <<
endmsg;
delete tf;
tf = 0;
return 1;
}
} else {
try {
tf = TFile::Open(
n.c_str(),opt.c_str());
} catch (const std::exception& Exception) {
<< " file for reading: " << Exception.what() << std::endl
<<
" -> file probably corrupt." <<
endmsg;
return 1;
} catch (...) {
<<
"\": probably corrupt" <<
endmsg;
return 1;
}
}
if (tf == 0 || !tf->IsOpen()) {
<<
"\" with options \"" << opt <<
"\"" <<
endmsg;
delete tf;
tf = 0;
return 1;
}
fd = tf->GetFd();
ptr = (void*) tf;
return 0;
}