PDA

View Full Version : echo filename



efilnikufecin
01-07-2007, 08:17 PM
string filename = "\chardata\\" + my_name() + "_data.inf";
cli_execute("mirror " + filename);
print("something");
cli_execute("mirror");

for a while (long ago) that code worked as expected. It would create a folder named chardata in the kolmafia folder, and create a file in the folder as indicated above, or add to it if it already existed.

Now that I am needing to pay attention to this file again, I notice:
A> it's in a folder called "hardata" instead of "chardata"
B> the file get's overwritten every time.

So my questions are:
A> what format is kolmafia now expecting for the filename parameter to the mirror command?
B> is there a way to make it not over-write the file?
C> why is kolmafia creating a file in the same folder with the full filename of the file I want there with the ".echo" extension added onto it?

holatuwol
01-08-2007, 12:51 PM
A> You need an extra backslash to start out to escape out your first backslash. So your first line should be "\\chardata" instead of "\chardata".

B> At this time, no. I prefer append for everything, but I got weird stack traces when I forced everything to append, and I've never bothered to figure out what was really causing those stack traces.

C> Someone indicated that there was a security hole where KoLmafia could write to Desktop.ini (or some similar configuration file). So, .echo was added to everything to make sure that KoLmafia never touched such files.