+
+void DirScanner::unlink(const struct dirent* ent, int flags)
+{
+ UnixError::check(::unlinkat(dirfd(this->dp), ent->d_name, flags));
+}
+
+bool DirScanner::isRegularFile(dirent* dp)
+{
+ switch (dp->d_type) {
+ case DT_REG:
+ return true;
+ default:
+ return false;
+ case DT_UNKNOWN:
+ {
+ struct stat st;
+ MacOSError::check(::stat((this->path + "/" + dp->d_name).c_str(), &st));
+ return S_ISREG(st.st_mode);
+ }
+ }
+}
+