summaryrefslogtreecommitdiff
path: root/generic/Output.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'generic/Output.cpp')
-rw-r--r--generic/Output.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/generic/Output.cpp b/generic/Output.cpp
index aace79c..72d00cf 100644
--- a/generic/Output.cpp
+++ b/generic/Output.cpp
@@ -49,6 +49,18 @@ bool Output::CanSeek() {
return S_ISREG(s.st_mode);
}
+off_t Output::seek(off_t offset, int whence) throw (GeneralException) {
+ if ((itell = lseek(GetHandle(), offset, whence)) < 0) {
+ throw IOGeneral(String(_("Error seeking file ")) + n + _(": ") + strerror(errno));
+ }
+#ifdef PARANOID_SEEK
+ if (itell != lseek(GetHandle(), 0, SEEK_CUR)) {
+ throw IOGeneral(String(_("Error seeking file ")) + n + _(": the position does not match"));
+ }
+#endif
+ return itell;
+}
+
String Output::GetName() {
return n;
}