#include #include #include #include #include #include #include #include "Output.h" #include "Exceptions.h" #include "config.h" Output::Output(String no, int trunc = 1) throw (GeneralException) : Handle(no.strlen() ? open(no.to_charp(), O_WRONLY | O_CREAT | (trunc ? O_TRUNC : O_APPEND)) : 1), n(no) { if (GetHandle() < 0) { throw IOGeneral(String("Error opening file") + no + " for writing: " + strerror(errno)); } } bool Output::CanWrite() { return 1; } bool Output::CanRead() { return 0; } String Output::GetName() { return n; }