6 using namespace IOFlags;
69 m_flags = autoclose ? InternalAutoClose : 0;
81 { open (name, flags, perms); }
85 { open (name.c_str (),
flags, perms); }
92 if (m_flags & InternalAutoClose)
105 m_flags &= ~InternalAutoClose;
107 m_flags |= InternalAutoClose;
119 File *dup =
new File (fd (), copy ? m_flags : 0);
120 return copy ? this->
duplicate (dup) : dup;
128 IOFD fd = this->fd ();
131 child->
fd (sysduplicate (fd));
170 { open (name.c_str (),
flags, perms); }
192 unsigned newflags = InternalAutoClose;
194 sysopen (name, flags, perms, newfd, newflags);
212 IOFD fd = this->fd();
217 info.ra_offset = what[
i].
offset();
218 info.ra_count = what[
i].
size();
219 fcntl(fd, F_RDADVISE, &info);
220 #elif _POSIX_ADVISORY_INFO > 0
221 posix_fadvise(fd, what[
i].
offset(), what[
i].
size(), POSIX_FADV_WILLNEED);
223 # error advisory read ahead not available on this platform
279 IOFD fd = this->fd ();
283 if (! sysclose (fd, &error))
287 m_flags &= ~InternalAutoClose;
295 IOFD fd = this->fd ();
299 m_flags &= ~InternalAutoClose;
virtual IOSize readv(IOBuffer *into, IOSize length)
virtual void setAutoClose(bool closeit)
void throwStorageError(const char *category, const char *context, const char *call, int error)
virtual void create(const char *name, bool exclusive=false, int perms=0666)
virtual IOSize writev(const IOBuffer *from, IOSize buffers)
std::vector< Variable::Flags > flags
virtual void attach(IOFD fd)
virtual bool prefetch(const IOPosBuffer *what, IOSize n)
virtual void open(const char *name, int flags=IOFlags::OpenRead, int perms=0666)
static const boost::regex duplicate("duplicateIOV[[:print:]]+?[S|s]ince[=| ]([[:alnum:]]+?);.*")
virtual IOSize writev(const IOBuffer *from, IOSize length)
virtual IOSize write(const void *from, IOSize n)
IOOffset offset(void) const
virtual IOSize write(const void *from, IOSize n)
static int position[264][3]
File * duplicate(bool copy) const
virtual IOFD fd(void) const
tuple size
Write out results.
virtual IOSize readv(IOBuffer *into, IOSize buffers)