#include "__read.h" #include "Exception.h" #include #include namespace jet { __read::__read(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) { if(!variableDefined(coreutils::ZString("file"))) throw coreutils::Exception("file keyword must be specified."); if(hasContainer) throw coreutils::Exception("read tag does not have a container."); fd = open(variables["file"], O_RDONLY); while(len = read(fd, &buffer, sizeof(buffer - 1))) { buffer[len] = 0; out << buffer; } close(fd); } }