summaryrefslogtreecommitdiff
path: root/lib/Output.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Output.cc')
-rw-r--r--lib/Output.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Output.cc b/lib/Output.cc
index d1a00c5..82649e8 100644
--- a/lib/Output.cc
+++ b/lib/Output.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: Output.cc,v 1.26 2007-05-30 11:57:10 pixel Exp $ */
+/* $Id: Output.cc,v 1.27 2008-01-21 17:55:43 pixel Exp $ */
#include <stdio.h>
#include <string.h>
@@ -41,12 +41,20 @@
#define S_ISREG(x) 1
#endif
+int Output::nb_output = 0;
+
+int Output::GetNbOutput() {
+ return nb_output;
+}
+
Output::Output(String no, int create, int trunc) throw (GeneralException) :
Handle(no.strlen() ? wrapopen(no.to_charp(), create, trunc) : dup(1)),
n(no) {
if (GetHandle() < 0) {
throw IOGeneral(String(_("Error opening file ")) + no + _(" for writing: ") + strerror(errno));
}
+
+ nb_output++;
size = lseek(GetHandle(), 0, SEEK_END);
if (trunc)
@@ -101,6 +109,7 @@ int Output::wrapopen(const String & n, int create, int trunc) {
}
Output::Output(const Output & o) : Handle(o), n(o.n) {
+ nb_output++;
}
bool Output::CanWrite() const {