I’m trying to read some external files into tables (and vice versa). I’m having two main problems:
Released glulx files seem unable to find or recognize files no matter where they’re stored. No matter where I put an appropriately named .txt file, it will not read from it nor write to it. Nor will it create a new file to write to. I’ve tried pretty much every folder structure I could think of, with no luck.
Games run from inform will recognize the file in some locations (Release folder, mostly). But my simplified code neither writes nor reads from the file, although it doesn’t throw run-time errors on my machine. My more complicated code has an additional problem where it tries to write to files instead of reading from them, at least according to the run-time error, but I can’t diagnose whether that’s my problem or not without knowing what’s going wrong with the simple stuff.
This is making it very hard to troubleshoot, since I don’t know where it’s going wrong or what I’m missing.
Can anyone help, or at least confirm these issues on their machine?
(You’ll need to create a .txt file for the code below named testtext. I’m assuming you’ll need something in there, but maybe not?)
[code]“Forum” by Gravel
Test is a room.
The File of Testing is called “testtext”.
When play begins:
say “Looking for file.”;
if File of Testing exists:
say “File found.”;
read File of Testing into the Table of Suspicion;
write the File of Testing from Table of Suspicion.
repeat through the Table of Suspicion:
say example entry.
Table of Suspicion
example (indexed text)