[scilab-Users] How to get the current script directory ?

Gary Nelson gnelson at quantasonics.com
Mon Apr 19 13:15:30 CEST 2010


I am now more perplexed.
I am trying to develop a DSP system with lots of functions that I identify with exec( ) and that seems to work
but does not apparently leave the functions "open" as files
Are you saying I have to use mopen(function file name)?
Thanks
Gary Nelson

On Apr 19, 2010, at 3:21 AM, Samuel Gougeon wrote:

> ----- Message d'origine -----
> De : Gary Nelson
> Date : 17/04/2010 21:46:
>> This looks useful, but I can't get it to work.
>> 
>> I open the editor and load two files. One is a function called by the other file. I execute the tester.
>> Then go to the console and invoke get_absolute_file_path(script_filename).
>> 
>> I find the file name wants to be inside double quotes,
> yes, script_filename should be a string (variable or literal)
>> but even then I get an error that the file is not open in Scilab, despite having just executed it. I have tried both the function and the tester and get the same error -- file not open in Scilab.
>> 
> Interesting remark. Actually, for a file, being opened in the editor does not mean being opened in the Scilab session (console), even if the editor has been launched from the session. I agree that this does not look obvious. To check that : open a file in xpad (embedded editor); then in the console: dispfiles()  => The file opened in xpad is not listed.
> Moreover : The file is opened while it is beING executed. This is why in practical, get_absolute_file_path() can be used either in .sce scripts (list of instructions) ; or whether the file has been opened with mopen() of file(... "open"), and is currently running.
> 
> Samuel
> 
> 

Gary Nelson
gnelson at quantasonics.com






More information about the users mailing list