On 28 Jun 2000, Bruce Johnson wrote:
> I have not been able to figure out how to write a file while in
> Mathematica on the Mac to the active folder. If I double-click
> on a Mathematica 4.0 notebook in a folder, perform some calculations,
> then output some data to a file, that file is always the main
> Mathematica folder. I would like the output to default to the
> current folder (in Unix, Mathematica will output to the current directory).
> Is there a simple option for this?
The kernel supports the notion of a current working directory. For file
I/O operations that involve relative paths or just file names, the current
working directory will be used as the base for the absolute path. You can
query the kernel for the current value with the Directory[] function. To
change the directory, simply use SetDirectory[], which takes a path in the
form of a string.
--
P.J. Hinton
Mathematica Programming Group paulh at wolfram.com
Wolfram Research, Inc.
Disclaimer: Opinions expressed herein are those of the author alone.