Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg56043] Re: Set working directory? Read polynomial from text file?
  • From: Peter Pein <petsie at arcor.de>
  • Date: Thu, 14 Apr 2005 08:54:41 -0400 (EDT)
  • References: <d3g8br$seg$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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