4
$\begingroup$

I just upgraded from version 11.3.0 to version 12.1.0 and I am struggling with the directory of my .nb file. Usually I start all my .nb with

SetDirectory[NotebookDirectory[]]

But in this new version the past command sets my directory two levels above from the actual NotebookDirectory. I noted that this only happens when my files are inside of Dropbox.

Does anyone has this problem too? It didn't happen to me with version 11.

$\endgroup$
5
  • 1
    $\begingroup$ What is NotebookDirectory[]? Is it different that what you expect? Presumably that's the issue. Why that would be is maybe a communication issue between the FE and dropbox. $\endgroup$
    – b3m2a1
    Apr 12, 2020 at 4:30
  • $\begingroup$ Using 12.1, I saved a .nb file in Dropbox on Windows. Then executed SetDirectory[Notebook..]. Works as expected, that is the current working directory is the Dropbox folder where the .nb file is saved. $\endgroup$
    – FredrikD
    Apr 12, 2020 at 9:39
  • $\begingroup$ @FredrikD I am using Linux so maybe for this platform there's a buh (?) $\endgroup$ Apr 13, 2020 at 6:31
  • $\begingroup$ I am having the same problem. For me it only happens on the private folder not on the team folder. $\endgroup$
    – Daniel
    Apr 13, 2020 at 16:01
  • $\begingroup$ Also works fine for me on Mac OSX. But a student of mine once had a problem with this on Windows, when directory names in the path contained spaces. $\endgroup$ Jun 19, 2020 at 11:14

1 Answer 1

0
$\begingroup$

Do any of the folders in your folder structure include a special character (like ä, é, è, etc...)? I ended up on this question when searching about this issue myself. Once I removed the special characters in the folder structure the notebook was saved in, it worked as expected. As you mentioned though, this wasn't the behavior for previous versions (I tested using version 10.2).

The result of NotebookDirectory[] will be the folder in the structure who's full path does not contain any special character. IMO, it should be reverted back to the old behavior.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.