diff --git a/src/cryfs/filesystem/CryNode.cpp b/src/cryfs/filesystem/CryNode.cpp index 70ee278f..3546d796 100644 --- a/src/cryfs/filesystem/CryNode.cpp +++ b/src/cryfs/filesystem/CryNode.cpp @@ -7,6 +7,7 @@ #include "CryFile.h" #include #include +#include namespace bf = boost::filesystem; @@ -106,6 +107,19 @@ void CryNode::stat(struct ::stat *result) const { result->st_gid = getgid(); result->st_mode = S_IFDIR | S_IRUSR | S_IWUSR | S_IXUSR; result->st_size = fsblobstore::DirBlob::DIR_LSTAT_SIZE; + //TODO If possible without performance loss, then for a directory, st_nlink should return number of dir entries (including "." and "..") + result->st_nlink = 1; + struct timespec now; + clock_gettime(CLOCK_REALTIME, &now); +#ifdef __APPLE__ + result->st_atimespec = now; + result->st_mtimespec = now; + result->st_ctimespec = now; +#else + result->st_atim = now; + result->st_mtim = now; + result->st_ctim = now; +#endif } else { (*_parent)->statChild(_key, result); }