I am a little confused because I belief that the behaviour of SetDirectory was different before. The intention is to be able to open notebooks in the same folder only by specifying the file name, starting from "Main.nb":
(* sets current dir *)
SetDirectory[NotebookDirectory[]]
and, for checking purposes:
(* check 1... *)
Directory[]
(* yields *)
C:\Users\armin\Documents\Temp\Test
and
(* check 2... *)
FileNames[]
(* yields *)
{Main.nb, Sub.nb}
But then, unfortunately:
In[26]:= (* however... *)
NotebookOpen["Sub.nb"]
Out[26]= $Failed
I was hoping, that the initial SetDirectory[NotebookDirectory[]]
would be sufficient.
That is working, of course:
In[27]:= (* instead, this works *)
NotebookOpen[FileNameJoin[{NotebookDirectory[], "Sub.nb"}]]
Out[27]= NotebookObject["bunch-of-characters..."]
I know, there is a similar question, but with slightly different subject: SetDirectory[NotebookDirectory[]] in one notebook causes Directory[] to change in a different notebook
Any comments?