MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Set working directory? Read polynomial from text file?


xxxxyz at abv.bg wrote:
> Hi,
> 
> I have two questions:
> 
> 1. How can I set working directory that when I restart Mathematica the
> wotking directory is that I set previous time? I use
> SetDirectory["dir"] but when I restart Mathematica the working
> directory is the original "C:\Program file...".
> 
...

> Thanks.
> 

I've put

If[FileType[#]===File,Get[#]]&[$UserBaseDirectory<>"\\setdir.inc"];

into my init.m and

(WriteString[#,"SetDirectory[\"",StringReplace[Directory[],"\\"->"\\\\"],"\"];"];
Close[#])&@OpenWrite[$UserBaseDirectory<>"\\setdir.inc"];

into end.m.

 This works as expected iff I enter Quit[] or Exit[] explicitly but not
when using the menu File->Exit. Is this a bug or is there a good reason
for skipping the execution of end.m when terminating the session via
menu? I can't find any hints in the help :-(

-- 
Peter Pein
Berlin


  • Prev by Date: Re: rasterarray border?
  • Next by Date: Re: Output format
  • Previous by thread: Re: Set working directory? Read polynomial from text file?
  • Next by thread: local symbols inside Module