ls.cpp with test for stat