From bfa5de7eccf4604ff8217f619e9685a09e80d545 Mon Sep 17 00:00:00 2001 From: Pixel Date: Fri, 27 Sep 2002 12:17:57 +0000 Subject: The week-without-the-network changes --- generic/Output.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'generic/Output.cpp') diff --git a/generic/Output.cpp b/generic/Output.cpp index 55ab158..b072236 100644 --- a/generic/Output.cpp +++ b/generic/Output.cpp @@ -14,7 +14,7 @@ #endif Output::Output(String no, int create, int trunc) throw (GeneralException) : - Handle(no.strlen() ? open(no.to_charp(), O_WRONLY | (O_CREAT * (create ? 1 : 0)) | (trunc ? O_TRUNC : O_APPEND) + Handle(no.strlen() ? open(no.to_charp(), O_WRONLY | (O_CREAT * (create ? 1 : 0)) | (O_TRUNC * (trunc ? 1 : 0)) #if defined __linux__ || defined __CYGWIN32__ , 00666 #endif @@ -37,15 +37,15 @@ Output::Output(String no, int create, int trunc) throw (GeneralException) : Output::Output(const Output & o) : Handle(o), n(o.n) { } -bool Output::CanWrite() { +bool Output::CanWrite() const { return 1; } -bool Output::CanRead() { +bool Output::CanRead() const { return 0; } -bool Output::CanSeek() { +bool Output::CanSeek() const { struct stat s; fstat(GetHandle(), &s); @@ -65,35 +65,35 @@ off_t Output::seek(off_t offset, int whence) throw (GeneralException) { return itell; } -String Output::GetName() { +String Output::GetName() const { return n; } Stdout_t::Stdout_t() {} -bool Stdout_t::CanSeek() { +bool Stdout_t::CanSeek() const { return 0; } -String Stdout_t::GetName() { +String Stdout_t::GetName() const { return "Stdout"; } Stderr_t::Stderr_t() : Handle(dup(2)) {} -bool Stderr_t::CanWrite() { +bool Stderr_t::CanWrite() const { return 1; } -bool Stderr_t::CanRead() { +bool Stderr_t::CanRead() const { return 0; } -bool Stderr_t::CanSeek() { +bool Stderr_t::CanSeek() const { return 0; } -String Stderr_t::GetName() { +String Stderr_t::GetName() const { return "Stderr"; } -- cgit v1.2.3