use stat instead of ls, like in init_buildsystem