MathGroup Archive 2006

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

Search the Archive

Re: file question

  • To: mathgroup at
  • Subject: [mg70651] Re: file question
  • From: Bill Rowe <readnewsciv at>
  • Date: Sun, 22 Oct 2006 01:19:44 -0400 (EDT)

On 10/21/06 at 5:14 AM, dimmechan at (dimitris) wrote:

>I have a simple question

>Suppose the following

>OutputStream["file1.dat", 6]

>Do[WriteString["file1.dat", i, "    ", i^3, "\n"], {i, 1, 8}];

>The created file is saved in the following directory

>Directory[] "C:\\Program Files\\Wolfram Research\\Mathematica\\5.2"

>How can I save a file created in this way in another directory e.g.

>$BaseDirectory "C:\\Documents and Settings\\All Users\\Application

Either set the working directory to $BaseDirectory by doing


or include $BaseDirectory in the file name using ToFileName, i.e.,

filename = ToFileName[$BaseDirectory, "file.dat"]

and replace "file.dat" everywhere in your example code with 
filename defined as above
To reply via email subtract one hundred and four

  • Prev by Date: Re: file question
  • Next by Date: Re: Programming style: postfix/prefix vs. functional
  • Previous by thread: Re: file question
  • Next by thread: simple question