summaryrefslogtreecommitdiff
path: root/generic/Output.cpp
diff options
context:
space:
mode:
authorPixel <Pixel>2002-08-13 18:20:13 +0000
committerPixel <Pixel>2002-08-13 18:20:13 +0000
commit1d836e3fd9d3c4f9ce08b6a062dd597e5fe4e1dc (patch)
tree41cbf99c45ad771a4b9f1812f38cf396e738803e /generic/Output.cpp
parent89a43700b18c61d209ffb68db57e020f11a2daa9 (diff)
Worked a little more
Diffstat (limited to 'generic/Output.cpp')
-rw-r--r--generic/Output.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/generic/Output.cpp b/generic/Output.cpp
index dbc1892..aace79c 100644
--- a/generic/Output.cpp
+++ b/generic/Output.cpp
@@ -19,6 +19,15 @@ Output::Output(String no, int trunc) throw (GeneralException) :
if (GetHandle() < 0) {
throw IOGeneral(String(_("Error opening file ")) + no + _(" for writing: ") + strerror(errno));
}
+
+ size = lseek(GetHandle(), 0, SEEK_END);
+ lseek(GetHandle(), 0, SEEK_SET);
+
+ struct stat s;
+
+ fstat(GetHandle(), &s);
+
+ date_modif = s.st_mtime;
}
Output::Output(const Output & o) : Handle(o), n(o.n) {
@@ -32,17 +41,21 @@ bool Output::CanRead() {
return 0;
}
+bool Output::CanSeek() {
+ struct stat s;
+
+ fstat(GetHandle(), &s);
+
+ return S_ISREG(s.st_mode);
+}
+
String Output::GetName() {
return n;
}
-Stdout_t::Stdout_t() : Handle(dup(1)) {}
-
-bool Stdout_t::CanWrite() {
- return 1;
-}
+Stdout_t::Stdout_t() {}
-bool Stdout_t::CanRead() {
+bool Stdout_t::CanSeek() {
return 0;
}
@@ -60,6 +73,10 @@ bool Stderr_t::CanRead() {
return 0;
}
+bool Stderr_t::CanSeek() {
+ return 0;
+}
+
String Stderr_t::GetName() {
return "Stderr";
}