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;
141 if (!
m_client->Open(perms, openflags)
142 ||
m_client->LastServerResp()->status != kXR_ok) {
144 ex <<
"XrdClient::Open(name='" << name
145 <<
"', flags=0x" << std::hex << openflags
146 <<
", permissions=0" << std::oct << perms << std::dec
147 <<
") => error '" <<
m_client->LastServerError()->errmsg
148 <<
"' (errno=" <<
m_client->LastServerError()->errnum <<
")";
155 ex <<
"XrdClient::Stat(name='" << name
156 <<
") => error '" <<
m_client->LastServerError()->errmsg
157 <<
"' (errno=" <<
m_client->LastServerError()->errnum <<
")";
170 m_client->SendMonitoringInfo(crabJobId, &dictId);
171 edm::LogInfo(
"XrdFileInfo") <<
"Set monitoring ID to " << crabJobId <<
" with resulting dictId " << dictId <<
".";
177 edm::LogInfo(
"XrdFileInfo") <<
"Connection URL " << conn->GetCurrentUrl().GetUrl().c_str();
181 if (statsService.isAvailable()) {
182 statsService->setCurrentServer(host);
192 <<
"XrdFile::close(name='" <<
m_name
193 <<
"') called but the file is not open";
200 <<
"XrdFile::close(name='" <<
m_name
201 <<
"') failed with error '" <<
m_client->LastServerError()->errmsg
202 <<
"' (errno=" <<
m_client->LastServerError()->errnum <<
")";
226 if (n > 0x7fffffff) {
228 ex <<
"XrdFile::read(name='" <<
m_name <<
"', n=" << n
229 <<
") too many bytes, limit is 0x7fffffff";
237 ex <<
"XrdClient::Read(name='" <<
m_name
238 <<
"', offset=" <<
m_offset <<
", n=" << n
239 <<
") failed with error '" <<
m_client->LastServerError()->errmsg
240 <<
"' (errno=" <<
m_client->LastServerError()->errnum <<
")";
252 if (n > 0x7fffffff) {
254 ex <<
"XrdFile::read(name='" <<
m_name <<
"', n=" << n
255 <<
") exceeds read size limit 0x7fffffff";
263 ex <<
"XrdClient::Read(name='" <<
m_name
264 <<
"', offset=" <<
m_offset <<
", n=" << n
265 <<
") failed with error '" <<
m_client->LastServerError()->errmsg
266 <<
"' (errno=" <<
m_client->LastServerError()->errnum <<
")";
277 if (n > 0x7fffffff) {
279 ex <<
"XrdFile::write(name='" <<
m_name <<
"', n=" << n
280 <<
") too many bytes, limit is 0x7fffffff";
288 ex <<
"XrdFile::write(name='" <<
m_name <<
"', n=" << n
289 <<
") failed with error '" <<
m_client->LastServerError()->errmsg
290 <<
"' (errno=" <<
m_client->LastServerError()->errnum <<
")";
305 if (n > 0x7fffffff) {
307 ex <<
"XrdFile::write(name='" <<
m_name <<
"', n=" << n
308 <<
") too many bytes, limit is 0x7fffffff";
313 ssize_t
s =
m_client->Write(from, pos, n);
316 ex <<
"XrdFile::write(name='" <<
m_name <<
"', n=" << n
317 <<
") failed with error '" <<
m_client->LastServerError()->errmsg
318 <<
"' (errno=" <<
m_client->LastServerError()->errnum <<
")";
323 if (pos + s >
m_stat.size)
338 std::vector<long long> offsets; offsets.resize(n);
339 std::vector<int> lens; lens.resize(n);
344 total += what[
i].
size();
347 kXR_int64
r =
m_client->ReadV(
NULL, &offsets[0], &lens[0], n);
359 ex <<
"XrdFile::position() called on a closed file";
380 ex <<
"XrdFile::position() called with incorrect 'whence' parameter";
398 ex <<
"XrdFile::resize(name='" <<
m_name <<
"') not implemented";
409 std::stringstream ss;
410 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()
volatile std::atomic< bool > shutdown_flag false
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)