How to get a script's directory

ZeWaren / Erwan Martin main at zewaren.net
Sat Jun 20 21:53:52 CEST 2009


Hi,
I'm writing scilab scripts (.sci files) on a daily basic.
Theses scripts need to access some files around them, typically graphs.

How can I get the location of the script in a variable, so that I can do 
something like this?:
    cpath=get_script_path();
    graph=load_graph(cpath+'some_graph.graph');
I need to be able to execute my scripts on different computers in 
different places on different operating systems.
I know that I can get scilab's current working directory using pwd() and 
change it using cd(...), but this doesn't solve my problem.

Thanks for any response.

-- 
Erwan MARTIN / ZeWaren
----------------------------------------------------
IRL:  ARPEJ Lgt 453G, 1360 rte de Ste Anne, 
      29280 PLOUZANE, FRANCE
tel:  +33(0)9.51.66.58.34  cell: +33(0)6.32.01.15.01
80:   http://zewaren.net       25:  public at fzwte.net
5222: zewaren at rezid.org        1863:  main at fzwte.net
----------------------------------------------------





More information about the users mailing list