# How to use relative paths in a notebook? [duplicate]

To maintain mobility of project files, I want to use relative paths in my notebooks. For example, I have a directory named "proj" and my notebook file is located in this directory. Meanwhile, I have to import something from directory "proj/data/". How do I get a relative path to "data"? I want to do this because I might move "proj" somewhere else in my file system.

• I have marked this as a duplicate. If you feel that your question is not addressed there please tell me why. – Mr.Wizard Jan 3 '14 at 9:46

FileNameJoin@Append[FileNameSplit@NotebookDirectory[], "data"]

• Why not just FileNameJoin[{NotebookDirectory[], "data"}]? – MikeLimaOscar Jan 3 '14 at 9:31