read tag working.

This commit is contained in:
Brad Arant committed 2024-07-11 15:25:48 -07:00
1 parent e1be28e53b
commit 15f7b08d68
5 files changed
+12 -6

No files matched your search

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