0xDEADBEEF Posted January 20, 2016 Share Posted January 20, 2016 Hi guys! I'm going circles! I'm trying to write a file like this: local function exportstats() local exportData = "text" exportFile = io.open("file.lua", "w") exportFile:write(exportData) exportFile:close() end at first io and lfs were sanitized, i commented the two lines in MissionScripting.lua then the file would still not open, although io not being nil, io.open() returned nil, launching DCS in Admin mode solved this error. So now the script runs error free, but there is no file anywhere :huh: I got absolutely no clue whats wrong ... any help is very much appreciated! thanks! beef Link to comment Share on other sites More sharing options...
Ciribob Posted January 20, 2016 Share Posted January 20, 2016 Does it work with an absolute path? I would guess its somewhere in the dcs program folder if its requiring admin privileges. Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :) DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord Link to comment Share on other sites More sharing options...
0xDEADBEEF Posted January 20, 2016 Author Share Posted January 20, 2016 i wonder why I didnt look there in the first place :O thanks mate! is there any variable/function/reference to the missions folder in saved games? I don't quite feel like typing an absolute path on my harddrive, in case I ever move it to a server it wont work anymore ... Link to comment Share on other sites More sharing options...
Ciribob Posted January 20, 2016 Share Posted January 20, 2016 Not that I know of, sorry! Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :) DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord Link to comment Share on other sites More sharing options...
0xDEADBEEF Posted January 20, 2016 Author Share Posted January 20, 2016 (edited) Now that the file is there (i expected the windows search to be more exact) my brain works sufficiently again to find how to find out the current directory: lfs.writedir() returns a string to the current directory. thanks for your help! Edited January 25, 2016 by 0xDEADBEEF deleted wrong assumtion Link to comment Share on other sites More sharing options...
Recommended Posts