| Message |
This is strange, and the first time I have heard of this. To clarify, you are using scripting (a script file) in one world only? That is, you don't have multiple worlds open at once sharing the same file?
So, you open the world, which automatically loads the script file, is that correct?
Then, you edit the script file using the built-in notepad? Or have you set the editor to some other editor? You edit OK, but can't save it?
First thing to consider is, does MUSHclient keep the script file open? Well, here is the code in question:
// open script file
CFile fileScript (m_strScriptFilename, CFile::modeRead | CFile::shareDenyWrite);
char * p = m_strScript.GetBuffer (fileScript.GetLength ());
// read in the script
fileScript.Read (p, fileScript.GetLength ());
// m_strScript now contains the entire script file
m_strScript.ReleaseBuffer (fileScript.GetLength ());
// close the file in case they try to modify it
fileScript.Close ();
You can see that the file is indeed opened to deny writing, however the last line closes the file, so it should now be possible to write to it. Judging by the MFC code, it should have thrown an exception if the file failed to close.
Does this happen the first time you edit the file? Or the second time? Maybe the editor doesn't close the file, especially if you use a different editor.
I would follow David's suggestion and try putting the script file on a local drive (like C:), as there may be problems with the way files are closed if you are using a network or USB drive to hold the file.
Also, I don't think this is related to Lua somehow. You could try temporarily making the script file VBscript (even with an empty file) and see if the problem persists. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|