Re: [eclipse-clp-users] Finding the ECLiPSE startup directory

From: Joachim Schimpf <joachim.schimpf_at_...44...>
Date: Tue, 17 Mar 2009 20:48:41 +1100
Paulo Moura wrote:
...
> 
> Allow me to briefly describe the problem I'm trying to solve. When  
> starting up Logtalk (using ECLiPSE as the back-end Prolog compiler),  
> the startup (Prolog) script looks into the current directory for a  
> settings file.

If Logtalk were an ECLiPSe library module it could contain a directive
:- export initialization(load_settings_file).
When a user imports/use_module/libs this module, load_settings_file/0
gets executed in the original current directory, which is what you want.

But I think you can't use this trick because logtalk is not a module.
Please don't use :- local initialization() instead - it currently
works as above (as long as the file isn't pre-compiled), but I'd
consider this a bug, so don't rely on it please.

I suppose we could introduce a global setting analogous to get_flag(cwd,D)
that returns the startup directory.  But, as Kish said, you can start
eclipse (via script or shortcut) with a -e option to save the startup
directory yourself:   eclipse -e "getcwd(D),setval(startup_cwd,D),..."


-- Joachim
Received on Tue Mar 17 2009 - 10:30:49 CET

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST