make Session::get_remote_nth_stripable() ignore hidden stripables unless asked.
[ardour.git] / libs / ardour / find_session.cc
index 67aa43d071403df44785e9a9869852af16333287..af39a475277a940ae6d0fc95d5b4cb8c8d49de3a 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Paul Davis 
+    Copyright (C) 2012 Paul Davis
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 */
 
 #include <unistd.h>
-#include <sys/stat.h>
 
 #include <cstring>
 #include <climits>
 #include <cerrno>
 
+#include "pbd/gstdio_compat.h"
+
 #include <glibmm/miscutils.h>
 
 #include "pbd/compose.h"
@@ -34,7 +35,7 @@
 #include "ardour/utils.h"
 #include "ardour/session_utils.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace PBD;
@@ -44,7 +45,7 @@ namespace ARDOUR {
 int
 find_session (string str, string& path, string& snapshot, bool& isnew)
 {
-       struct stat statbuf;
+       GStatBuf statbuf;
 
        isnew = false;
 
@@ -52,7 +53,7 @@ find_session (string str, string& path, string& snapshot, bool& isnew)
 
        /* check to see if it exists, and what it is */
 
-       if (stat (str.c_str(), &statbuf)) {
+       if (g_stat (str.c_str(), &statbuf)) {
                if (errno == ENOENT) {
                        isnew = true;
                } else {
@@ -81,7 +82,7 @@ find_session (string str, string& path, string& snapshot, bool& isnew)
 
                                /* is it there ? */
 
-                               if (stat (tmp.c_str(), &statbuf)) {
+                               if (g_stat (tmp.c_str(), &statbuf)) {
                                        error << string_compose (_("cannot check statefile %1 (%2)"), tmp, strerror (errno))
                                              << endmsg;
                                        return -1;