Jump to content
The simFlight Network Forums

Change path


Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.