On the other platform, I've set it up to say:
Can I read the file? No.
Can I read the file? No.
Can I read the file? Yes! Read file into memory then close!
I need to do that same thing with NinjaScript. Right now I'm having it store lines to be written in a Queue<string>. I need to have it say:
Can I write to the file? No.
Can I write to the file? No.
Can I write to the file? Yes! Dump the Queue into the file then close it!
Here's what I have:
WriteQueue.Enqueue(LineToExport);
if (WriteQueue.Count >= 10)
{
File.AppendAllText(path, LineToExport);
}
Everything dies if the file is open currently. I'm pretty new at this language and just don't know how to get it there, or even if this System.IO.File class is the right way to go about it. Does this look like it could work? Do I just need to stick a try{} block around it and I'm good to go?
Comment