hey everyone,
I'm trying to write data with game.write_file(path, data) however it does not work at all, neither in a mod nor when I run it via the ingame console with /c game.write_file('/home/user/text.txt', 'hello there')
when exactly does the game flush the written data? right after the call or does it cache all calls to write_data and waits for the game to close?
I'm on ubuntu, is there anything special I need to be aware of other than sufficient permissions?
[solved] game.write_file does not work at all
[solved] game.write_file does not work at all
Last edited by mpk on Thu May 03, 2018 7:18 am, edited 1 time in total.
Re: game.write_file does not work at all
See Factorio\script-output
-
- Filter Inserter
- Posts: 478
- Joined: Sat Aug 23, 2014 11:43 pm
- Contact:
Re: game.write_file does not work at all
It should write the file immediately. If you are running this in multiplayer, try with the command /c game.write_file("text.txt", "hello there", false, 1)mpk wrote:When exactly does the game flush the written data? right after the call or does it cache all calls to write_data and waits for the game to close?
Waste of bytes : P
Re: game.write_file does not work at all
Yup there it is, that solves it. Factorio file writes seem to take this directory always as their rootdarkfrei wrote:See Factorio\script-output
This should be noted in the api wiki.