]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/file-path.cc
patch::: 1.3.58.jcn2
[lilypond.git] / flower / file-path.cc
index 5f430ce9a070f6941a2c18e5ab7544f39c1efd03..10df133946ee45fe911d512d60a349332c912dc5 100644 (file)
@@ -110,10 +110,27 @@ File_path::find (String nm) const
   return "";
 }
 
+/**
+   Add an directory, return false if failed
+ */
+bool
+File_path::try_add (String s)
+{
+  if (s == "")
+    s =  ".";
+  FILE  * f = fopen (s.ch_C(), "r");
+  if (!f)
+    return false;
+  fclose (f);
+    
+  push (s);
+  return true;
+}
+
 void
 File_path::add (String s)
 {
-   push (s); 
+  push (s);
 }
 
 String