32 open (name, flags, perms);
53 <<
"Destructor called on XROOTD file '" <<
m_name
54 <<
"' but the file is still open";
93 if ((name == 0) || (*name == 0)) {
95 ex <<
"Cannot open a file without a name";
101 ex <<
"Must open file '" << name <<
"' at least for read or write";
115 openflags |= kXR_open_updt;
117 openflags |= kXR_open_read;
121 ex <<
"Opening file '" << name <<
"' in append mode not supported";
129 openflags |= kXR_delete;
130 openflags |= kXR_new;
131 openflags |= kXR_mkpath;
135 openflags |= kXR_delete;
139 if (!
m_client->Open(perms, openflags)
140 ||
m_client->LastServerResp()->status != kXR_ok) {
142 ex <<
"XrdClient::Open(name='" << name
143 <<
"', flags=0x" << std::hex << openflags
144 <<
", permissions=0" << std::oct << perms << std::dec
145 <<
") => error '" <<
m_client->LastServerError()->errmsg
146 <<
"' (errno=" <<
m_client->LastServerError()->errnum <<
")";
153 ex <<
"XrdClient::Stat(name='" << name
154 <<
") => error '" <<
m_client->LastServerError()->errmsg
155 <<
"' (errno=" <<
m_client->LastServerError()->errnum <<
")";
168 m_client->SendMonitoringInfo(crabJobId, &dictId);
169 edm::LogInfo(
"XrdFileInfo") <<
"Set monitoring ID to " << crabJobId <<
" with resulting dictId " << dictId <<
".";
175 edm::LogInfo(
"XrdFileInfo") <<
"Connection URL " << conn->GetCurrentUrl().GetUrl().c_str();
179 if (statsService.isAvailable()) {
180 statsService->setCurrentServer(host);
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)
336 std::vector<long long> offsets; offsets.resize(n);
337 std::vector<int> lens; lens.resize(n);
342 total += what[
i].
size();
345 kXR_int64
r =
m_client->ReadV(
NULL, &offsets[0], &lens[0], n);
357 ex <<
"XrdFile::position() called on a closed file";
378 ex <<
"XrdFile::position() called with incorrect 'whence' parameter";
396 ex <<
"XrdFile::resize(name='" <<
m_name <<
"') not implemented";
407 std::stringstream ss;
408 ss <<
"Current server connection: " << conn->GetCurrentUrl().GetUrl().c_str();
virtual void resize(IOOffset size)
#define PREFETCH_PROBE_LENGTH
virtual void create(const char *name, bool exclusive=false, int perms=0666)
std::vector< Variable::Flags > flags
virtual bool prefetch(const IOPosBuffer *what, IOSize n)
virtual IOOffset position(void) const
void addAdditionalInfo(std::string const &info)
unsigned int offset(bool)
IOOffset offset(void) const
virtual IOOffset size(void) const
void addContext(std::string const &context)
pthread_mutex_t m_readv_mutex
static const char * getJobID()
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)