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: <email@example.com>
- 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