JeViCo Posted June 18, 2019 Share Posted June 18, 2019 Hi guys! I've recently tried to change file client-side however i got none. meta.xml: <meta> <script src="client.Lua" type="client" /> <file src="testfile.txt" /> </meta> testfile.txt (server-side): sometext here client.Lua: local file = fileOpen('testfile.txt') fileClear(file) -- clear file local content = 'some new text' fileWrite(file, content) print(#content) -- got 13 print(#fileRead(file, fileGetSize(file))) -- always get 0 fileClose(file) acl.xml has resource.* permission and debug doesn't give any hints any ideas?? i used this function (same happens if a recreate file) Link to comment
N3xT Posted June 18, 2019 Share Posted June 18, 2019 Try this: local file = fileOpen('testfile.txt') fileClear(file) -- clear file local content = 'some new text' fileWrite(file, content) print(#content) -- got 13 local fileContent = fileRead(file, fileGetSize(file)) fileClose(file) print(#fileContent) Link to comment
Moderators IIYAMA Posted June 18, 2019 Moderators Share Posted June 18, 2019 @JeViCo There is nothing written on that file yet, not until the is finished. That poor creature needs a toilet and fast. https://wiki.multitheftauto.com/wiki/FileFlush 1 1 Link to comment
JeViCo Posted June 19, 2019 Author Share Posted June 19, 2019 it seems working. Thank you! You saved my time 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now