noisy logging turned on to help look for bug in directory tree.
[feisty_meow.git] / nucleus / library / filesystem / filename.cpp
index 1ab0c0d496dabf4c1503e3414b9fc5ebb871bda6..2a97d3a44683112f17c371bef79be50d48693f5f 100644 (file)
@@ -304,6 +304,18 @@ bool filename::is_executable() const
   return !!(fill.st_mode & S_IEXEC);
 }
 
+bool filename::is_normal() const
+{
+  status_info fill;
+  if (!get_info(&fill))
+    return false;
+  bool weird = S_ISCHR(fill.st_mode)
+      || S_ISBLK(fill.st_mode)
+      || S_ISFIFO(fill.st_mode)
+      || S_ISSOCK(fill.st_mode);
+  return !weird;
+}
+
 int filename::find_last_separator(const astring &look_at) const
 {
   int last_sep = -1;