OutputFile implements read() and readx(); beware --stdout.
This commit is contained in:
@@ -410,6 +410,22 @@ void OutputFile::seek(off_t off, int whence)
|
|||||||
super::seek(off,whence);
|
super::seek(off,whence);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int OutputFile::read(void *buf, int len)
|
||||||
|
{
|
||||||
|
InputFile infile;
|
||||||
|
infile.open(this->getName(), O_RDONLY);
|
||||||
|
infile.seek(this->tell(), SEEK_SET);
|
||||||
|
return infile.read(buf, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
int OutputFile::readx(void *buf, int len)
|
||||||
|
{
|
||||||
|
InputFile infile;
|
||||||
|
infile.open(this->getName(), O_RDONLY);
|
||||||
|
infile.seek(this->tell(), SEEK_SET);
|
||||||
|
return infile.readx(buf, len);
|
||||||
|
}
|
||||||
|
|
||||||
void OutputFile::set_extent(off_t offset, off_t length)
|
void OutputFile::set_extent(off_t offset, off_t length)
|
||||||
{
|
{
|
||||||
super::set_extent(offset, length);
|
super::set_extent(offset, length);
|
||||||
|
|||||||
@@ -141,6 +141,8 @@ public:
|
|||||||
// FIXME - these won't work when using the '--stdout' option
|
// FIXME - these won't work when using the '--stdout' option
|
||||||
virtual void seek(off_t off, int whence);
|
virtual void seek(off_t off, int whence);
|
||||||
virtual void rewrite(const void *buf, int len);
|
virtual void rewrite(const void *buf, int len);
|
||||||
|
virtual int read(void *buf, int len);
|
||||||
|
virtual int readx(void *buf, int len);
|
||||||
|
|
||||||
// util
|
// util
|
||||||
static void dump(const char *name, const void *buf, int len, int flags=-1);
|
static void dump(const char *name, const void *buf, int len, int flags=-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user