Code to fork directory