Get the 'real' mode from lstat.
Add test required files to Makefile
Add test.