Re: Export: Where is exported file?
- To: mathgroup at smc.vnet.net
- Subject: [mg37787] Re: Export: Where is exported file?
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 13 Nov 2002 01:10:53 -0500 (EST)
- Organization: Universitaet Leipzig
- References: <aqqe6p$sgg$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi, it is placed in the "current directory". If you use SetDirectory["someDirectory"] before calling Export[], the file is written in "someDirectory". You may use GetNotebookDirectory[nb_NotebookObject] /; $Notebooks := Module[{fname}, fname = "FileName" /. NotebookInformation[nb] /. FrontEnd`FileName[dir_, ___] :> ToFileName[dir]; If["FileName" == fname, fname = Directory[] <> $PathnameSeparator ]; fname ] and GetNotebookDirectory[SelectedNotebook[]] for the directory of the current notebook and Export[GetNotebookDirectory[SelectedNotebook[]]<>"yourfilename",yourData,"theFormat"] may work. Regards Jens DGolber wrote: > > When I do > > Export["picture.pdf", pict] > > the file picture.pdf ends up in the directory > > C:\Program Files\Wolfram Research\Mathematica\4.0 > > I can see how to alter this by putting the full name of the file in the > notebook, The "Get File Path" even makes this somewhat easy. > > But is there a settable Option or Preference governing the interpretation of > "filename" in Export[filename,data]? > > In particular, I would like to be able to tell it to put the file in the > Directory that the notebook came from. > > Doe Microsoft Windows have a notion of current directory? > Dave Golber