[Flightgear-devel] NASAL permissions

2011-09-13 Thread Adam Dershowitz, Ph.D., P.E.
I seem to have run into a problem with NASAL permissions.
I have a script that is giving me permission errors when it runs.  The scrip is 
in data/Nasal.  It contains this line:
var file=io.open(data/latlong.csv,mode=r);

and gives this error:

Nasal runtime error: io.open(): opening file 'data/latlong.csv' denied 
(unauthorized access)

Here is FG_ROOT:
FG_ROOT=/Applications/FlightGear.app/Contents/Resources/data

and this line is in data/Nasal/IOrules:

READ ALLOW $FG_ROOT/*
(default value, I haven't changed that file).

Shouldn't the rule allow the script to read that file?  

If I run the script right at the start of flightgear, that part works.  But, it 
won't then do what I want.  If, instead I use _setlistener, as I believe is the 
best way to way to wait for things to be initialized before running, I get the 
above error.  

I did figure out a work around, which is to open the file when the script is 
first run.  But then use _setlister to wait until the correct time to read the 
file.  

Any clarification or explanation?  

Thanks,

--Adam




--
BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerryreg; mobile platform with sessions, labs  more.
See new tools and technologies. Register for BlackBerryreg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] NASAL permissions

2011-09-13 Thread Csaba Halász
On Wed, Sep 14, 2011 at 12:37 AM, Adam Dershowitz, Ph.D., P.E.
adershow...@exponent.com wrote:

 I have a script that is giving me permission errors when it runs.  The scrip 
 is in data/Nasal.  It contains this line:
        var file=io.open(data/latlong.csv,mode=r);

Try this:
var file=io.open(getprop(/sim/fg-root) ~ /latlong.csv,mode=r);

-- 
Csaba/Jester

--
BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerryreg; mobile platform with sessions, labs  more.
See new tools and technologies. Register for BlackBerryreg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] NASAL permissions

2011-09-13 Thread Adam Dershowitz, Ph.D., P.E.


On Sep 13, 2011, at 4:17 PM, Csaba Halász wrote:

 On Wed, Sep 14, 2011 at 12:37 AM, Adam Dershowitz, Ph.D., P.E.
 adershow...@exponent.com wrote:
 
 I have a script that is giving me permission errors when it runs.  The scrip 
 is in data/Nasal.  It contains this line:
var file=io.open(data/latlong.csv,mode=r);
 
 Try this:
 var file=io.open(getprop(/sim/fg-root) ~ /latlong.csv,mode=r);
 

That does it.  

Thanks,


--
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage 
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel