Board index FlightGear Development Nasal

file read/write permission

Nasal is the scripting language of FlightGear.

file read/write permission

Postby gabrielalexm » Thu Jun 10, 2021 4:16 pm

Hello,
I have created a NASAL script that (tries) to write the coordinates of the aircraft when a screenshot is saved to a file. I get the error:
Code: Select all
   17.00 [ALRT]:nasal      open(): reading/writing '/Users/gmoreno/Library/Application Support/FlightGear/gps.csv' denied (unauthorized directory - authorization no longer follows symlinks; to authorize reading additional directories, pass them to --allow-nasal-read)


I create the path to the file with the following code:
Code: Select all
var gps_path = getprop("/sim/fg-home") ~ '/gps.csv';


I have tried other directories, and I have tried using the --allow-nasal-read command line option but still doesn't work. This is on macOS, and the NASAL code is in an aircraft.

So, I'm wondering if it is possible to write to a file from NASAL in FG? If so, how should I do it?

Thanks!
gabrielalexm
 
Posts: 6
Joined: Fri Mar 19, 2021 11:09 pm

Re: file read/write permission

Postby Hooray » Thu Jun 10, 2021 8:26 pm

You need to use a directory that is writable by Nasal, e.g. Exports
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: file read/write permission

Postby gabrielalexm » Fri Jun 11, 2021 5:23 pm

Hooray wrote in Thu Jun 10, 2021 8:26 pm:You need to use a directory that is writable by Nasal, e.g. Exports

That worked! Thanks!
gabrielalexm
 
Posts: 6
Joined: Fri Mar 19, 2021 11:09 pm


Return to Nasal

Who is online

Users browsing this forum: No registered users and 1 guest