Amaniera Posted April 7, 2020 Report 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
Pete Dowson Posted April 7, 2020 Report 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
Amaniera Posted April 8, 2020 Author Report 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
Amaniera Posted April 8, 2020 Author Report Posted April 8, 2020 Thanks a lot Pete, it works ! Best regards, Patrice
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