9 #define JOB_UNIQUE_ID_ENV "CRAB_UNIQUE_JOB_ID"
10 #define JOB_UNIQUE_ID_ENV_V2 "DashboardJobId"
34 open (name, flags, perms);
55 <<
"Destructor called on XROOTD file '" <<
m_name
56 <<
"' but the file is still open";
95 if ((name == 0) || (*name == 0)) {
97 ex <<
"Cannot open a file without a name";
103 ex <<
"Must open file '" << name <<
"' at least for read or write";
117 openflags |= kXR_open_updt;
119 openflags |= kXR_open_read;
123 ex <<
"Opening file '" << name <<
"' in append mode not supported";
131 openflags |= kXR_delete;
132 openflags |= kXR_new;
133 openflags |= kXR_mkpath;
137 openflags |= kXR_delete;
143 if (!
m_client->Open(perms, openflags)
144 ||
m_client->LastServerResp()->status != kXR_ok) {
146 ex <<
"XrdClient::Open(name='" << name
147 <<
"', flags=0x" << std::hex << openflags
148 <<
", permissions=0" << std::oct << perms << std::dec
149 <<
") => error '" <<
m_client->LastServerError()->errmsg
150 <<
"' (errno=" <<
m_client->LastServerError()->errnum <<
")";
157 ex <<
"XrdClient::Stat(name='" << name
158 <<
") => error '" <<
m_client->LastServerError()->errmsg
159 <<
"' (errno=" <<
m_client->LastServerError()->errnum <<
")";
174 m_client->SendMonitoringInfo(crabJobId, &dictId);
175 edm::LogInfo(
"XrdFileInfo") <<
"Set monitoring ID to " << crabJobId <<
" with resulting dictId " << dictId <<
".";
181 edm::LogInfo(
"XrdFileInfo") <<
"Connection URL " << conn->GetCurrentUrl().GetUrl().c_str();
190 <<
"XrdFile::close(name='" <<
m_name
191 <<
"') called but the file is not open";
198 <<
"XrdFile::close(name='" <<
m_name
199 <<
"') failed with error '" <<
m_client->LastServerError()->errmsg
200 <<
"' (errno=" <<
m_client->LastServerError()->errnum <<
")";
224 if (n > 0x7fffffff) {
226 ex <<
"XrdFile::read(name='" <<
m_name <<
"', n=" << n
227 <<
") too many bytes, limit is 0x7fffffff";
235 ex <<
"XrdClient::Read(name='" <<
m_name
236 <<
"', offset=" <<
m_offset <<
", n=" << n
237 <<
") failed with error '" <<
m_client->LastServerError()->errmsg
238 <<
"' (errno=" <<
m_client->LastServerError()->errnum <<
")";
250 if (n > 0x7fffffff) {
252 ex <<
"XrdFile::read(name='" <<
m_name <<
"', n=" << n
253 <<
") exceeds read size limit 0x7fffffff";
261 ex <<
"XrdClient::Read(name='" <<
m_name
262 <<
"', offset=" <<
m_offset <<
", n=" << n
263 <<
") failed with error '" <<
m_client->LastServerError()->errmsg
264 <<
"' (errno=" <<
m_client->LastServerError()->errnum <<
")";
275 if (n > 0x7fffffff) {
277 ex <<
"XrdFile::write(name='" <<
m_name <<
"', n=" << n
278 <<
") too many bytes, limit is 0x7fffffff";
286 ex <<
"XrdFile::write(name='" <<
m_name <<
"', n=" << n
287 <<
") failed with error '" <<
m_client->LastServerError()->errmsg
288 <<
"' (errno=" <<
m_client->LastServerError()->errnum <<
")";
303 if (n > 0x7fffffff) {
305 ex <<
"XrdFile::write(name='" <<
m_name <<
"', n=" << n
306 <<
") too many bytes, limit is 0x7fffffff";
311 ssize_t
s =
m_client->Write(from, pos, n);
314 ex <<
"XrdFile::write(name='" <<
m_name <<
"', n=" << n
315 <<
") failed with error '" <<
m_client->LastServerError()->errmsg
316 <<
"' (errno=" <<
m_client->LastServerError()->errnum <<
")";
321 if (pos + s >
m_stat.size)
341 ex <<
"XrdFile::position() called on a closed file";
362 ex <<
"XrdFile::position() called with incorrect 'whence' parameter";
380 ex <<
"XrdFile::resize(name='" <<
m_name <<
"') not implemented";
391 std::stringstream ss;
392 ss <<
"Current server connection: " << conn->GetCurrentUrl().GetUrl().c_str();
virtual void resize(IOOffset size)
virtual void create(const char *name, bool exclusive=false, int perms=0666)
std::vector< Variable::Flags > flags
#define JOB_UNIQUE_ID_ENV_V2
virtual bool prefetch(const IOPosBuffer *what, IOSize n)
virtual IOOffset position(void) const
void addAdditionalInfo(std::string const &info)
unsigned int offset(bool)
static std::string from(" from ")
void addContext(std::string const &context)
pthread_mutex_t m_readv_mutex
#define JOB_UNIQUE_ID_ENV
void addConnection(cms::Exception &)
virtual void open(const char *name, int flags=IOFlags::OpenRead, int perms=0666)
virtual IOSize write(const void *from, IOSize n)