Amaniera Posted April 7, 2020 Report Share Posted April 7, 2020 Hi Pete! I would like to know how, in the two lines of code I wrote, I can specify the path where I want to put the .txt file Here is my code: fileName = "Flight_report_" .. os.date('%d_%m_%y, %H_%M.txt') file = io.open(fileName, "w") Thanks in advance. Regards, Patrice Link to comment Share on other sites More sharing options...
Pete Dowson Posted April 7, 2020 Report Share Posted April 7, 2020 1 hour ago, Amaniera said: I would like to know how, in the two lines of code I wrote, I can specify the path where I want to put the .txt file Here is my code: fileName = "Flight_report_" .. os.date('%d_%m_%y, %H_%M.txt') file = io.open(fileName, "w") This is rather short of content. Are you talking about a Lua plug-in for FSUIPC, or sdome other application you are writing? As in all contexts, everywhere, the filename is not just a filename, it is a complete filepath, with is path and name, as in "C:\\MyTextFiles\\ .... .txt"). (Note the double \ needed in Lua like C C++ and other languages). Pete Link to comment Share on other sites More sharing options...
Amaniera Posted April 8, 2020 Author Report Share Posted April 8, 2020 Hi Pete, It if for an lua/FSUIPC software I am writing, as an add on for P3D. Best regards, Patrice Link to comment Share on other sites More sharing options...
Amaniera Posted April 8, 2020 Author Report Share Posted April 8, 2020 Thanks a lot Pete, it works ! Best regards, Patrice Link to comment Share on other sites More sharing options...
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