Closed Dutchman101 closed 6 years ago
Unable to reproduce
By reading the source code it's clear to me that File()
is not simply fileOpen()
as I would expect. File()
is more like a mix of fileOpen()
and fileCreate()
, with no option to open a file in read-only mode.
I suspect this problem happens to you and not to me because I'm on GNU/Linux, and your Windows server might interpret the filepaths in a different way. I suppose that when trying to open a file, the gobbler File()
function fails to identify the existence of the file and takes care of creating a new one.
Fixed in 32da40f
You can use File.open
if you want to keep OOPyness
Done in 0730411906002e17747249f2702b85ca338a2a22
All .LUA files will be emptied once the server is started. It seems not everyone can reproduce this, it was done with both a clean MTA server (1.5.5-r12430) directory and my usual local with the same results, everything was set up and running as it's supposed to be and the resources are master. Script files are emptied as soon the server is ready.
Reproduction video showing this behaviour which is opposite of what is expected: https://www.youtube.com/watch?v=anDrc1s8VW8
@expert975 suspects that the behaviour of File() (FileOpen function) has changed, or that the introduction of this issue relies on the lack of using read-only with FileOpen. I didn't investigate this gamemode bug at all so far, he did. Expert975 (on fileOpen function behaviour): "Perhaps what was opening a file to read now is opening to write (not to append)"