MathGroup Archive 2013

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

Search the Archive

Re: Comment about SetDirectory[]

  • To: mathgroup at
  • Subject: [mg130848] Re: Comment about SetDirectory[]
  • From: "Alexey Popkov" <lehin.p at>
  • Date: Tue, 21 May 2013 00:02:32 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • References: <kn77kd$8ig$>

Hi Paul,

I would not recommend to use  the

Export[NotebookDirectory[] <>  "TestResultTime.txt", mTimeDiff, "Table"]

form if you are exporting many such files because NotebookDirectory[] 
sometimes (approximately one time in 500 exports in one of my programs) 
returns nothing and the file is exported to the default directory.

As to your case I think it is possible that SetDirectory[] worked but 
NotebookDirectory[] failed... I would recommend to check the output of 
NotebookDirectory[] with StringLength.

with best wishes,

"McHale, Paul"  wrote:kn77kd$8ig$1 at

I have often wondered whether to use:

Export["TestResultTime.txt", mTimeDiff, "Table"]


Export[NotebookDirectory[] <>  "TestResultTime.txt", mTimeDiff, "Table"]

I have left Mathematica open for 2 days as it was running a very long test. 
Maybe something became corrupted.  The first method did not work.  It 
appears SetDirectory[] simply stopped functioning.  Personally, I think the 
second method is better since it is atomic in nature.  It doesn't depend on 
any stateful settings.

Has anyone else had this issue?


Paul McHale  |  Electrical Engineer, Energetic Systems   |  Excelitas 
Technologies Corp.

Office: +1 937.865.3004   |  Fax: +1 937.865.5170
1100 Vanguard Boulevard, Miamisburg, OH  45342-0312
Paul.McHale at

  • Prev by Date: Re: Comment about SetDirectory[]
  • Next by Date: Can't get FindMinimum[] to quit using value specified by
  • Previous by thread: Re: Comment about SetDirectory[]
  • Next by thread: Re: Comment about SetDirectory[]