18 <<
"Cannot change file but operation '" << why <<
"' was called";
23 : image_(base->
size()),
34 if (
char *
p = getenv(
"TMPDIR"))
38 pattern +=
"/cmssw-shadow-XXXXXX";
40 std::vector<char>
temp(pattern.c_str(), pattern.c_str()+pattern.size()+1);
41 int fd = mkstemp(&
temp[0]);
44 <<
"Cannot create temporary file '" << pattern <<
"': "
45 << strerror(errno) <<
" (error " << errno <<
")";
73 if (window == MAP_FAILED)
75 <<
"Unable to map a window of local cache file: "
76 << strerror(errno) <<
" (error " << errno <<
")";
85 std::ostringstream ost;
86 ost <<
"Unable to cache " << len <<
" byte file segment at " << start <<
": ";
94 <<
"Unable to cache " << len <<
" byte file segment at " << start
95 <<
": got only " << nread <<
" bytes back";
115 cache(here, here + n);
133 end += into[
i].
size();
154 {
nowrite(
"write");
return 0; }
158 {
nowrite(
"write");
return 0; }
162 {
nowrite(
"writev");
return 0; }
166 {
nowrite(
"writev");
return 0; }
virtual IOSize readv(IOBuffer *into, IOSize length)
tuple start
Check for commandline option errors.
void cache(IOOffset start, IOOffset end)
virtual IOSize readv(IOPosBuffer *into, IOSize buffers)
virtual IOSize read(void *into, IOSize n, IOOffset pos)
virtual bool prefetch(const IOPosBuffer *what, IOSize n)
virtual IOSize read(void *into, IOSize n)
virtual IOOffset position(void) const
virtual IOSize writev(const IOBuffer *from, IOSize n)
LocalCacheFile(Storage *base, const std::string &tmpdir="")
static const IOOffset CHUNK_SIZE
unsigned int offset(bool)
std::vector< char > present_
IOOffset offset(void) const
virtual IOOffset position(IOOffset offset, Relative whence=SET)
virtual IOSize write(const void *from, IOSize n)
virtual IOOffset size(void) const
virtual IOSize readv(IOBuffer *into, IOSize n)
virtual void resize(IOOffset size)
virtual bool prefetch(const IOPosBuffer *what, IOSize n)
virtual void resize(IOOffset size)
volatile std::atomic< bool > shutdown_flag false
virtual IOFD fd(void) const
tuple size
Write out results.
static void nowrite(const char *why)