Add parent paths while adding directories and files.
Parent dirs are added and samples are linked to dirs. Add transactions.