# 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.

-

## marked as duplicate by Mr.Wizard♦Jan 3 at 9:45

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

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