Torsten Anders wrote:
Dear all,
I want to feed an init file (.ozrc) when Oz is started. How can I do
that on Windows? That is, what is the Windows equivalent for
~/.oz/ozrc or ~/.ozrc? (cf.
http://doc.rz.ifi.lmu.de/programming/mozart/mozart/doc/opi/
node4.html#section.mozart)
The relevant code is in OPI.oz :
%% Try to load some ozrc file
local
fun {FileExists FileName}
try F in
F = {New Open.file init(name: FileName flags: [read])}
{F close()}
true
catch _ then false
end
end
in
case {OS.getEnv 'HOME'} of false then skip
elseof HOME then
OZRC = {OS.getEnv 'OZRC'}
in
if OZRC \= false andthen {FileExists OZRC} then
{OPICompiler enqueue(feedFile(OZRC))}
elseif {FileExists {Property.get 'oz.dotoz'}#'/ozrc'} then
{OPICompiler enqueue(feedFile({Property.get 'oz.dotoz'}#'/ozrc'))}
elseif {FileExists HOME#'/.oz/ozrc'} then
{OPICompiler enqueue(feedFile(HOME#'/.oz/ozrc'))}
elseif {FileExists HOME#'/.ozrc'} then % note: deprecated
{OPICompiler enqueue(feedFile(HOME#'/.ozrc'))}
end
end
end
The easiest way is probably to use the environment variables HOME (set
to whatever) and OZRC (set to the path to the .ozrc file)
(I don't have a windows machine available right now but need to help
some newbie..)
Thank you very much!
Best,
Torsten
Cheers,
Yves
--
Torsten Anders
Sonic Arts Research Centre • Queen's University Belfast
Frankstr. 49 • D-50996 Köln
Tel: +49-221-3980750
http://www.torsten-anders.de
http://strasheela.sourceforge.net
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users