summaryrefslogtreecommitdiff
path: root/libs/ardour/utils.cc
diff options
context:
space:
mode:
authorJohn Emmas <johne53@tiscali.co.uk>2015-10-04 14:18:54 +0100
committerJohn Emmas <johne53@tiscali.co.uk>2015-10-04 14:18:54 +0100
commitc68736bc028a4965df4d43d59e550ba3185054fb (patch)
tree1c9b33f16e2f93ee621d0ad7246959513e9ab136 /libs/ardour/utils.cc
parentcf33204e358de6ee2f46a7c595e27948994c80bf (diff)
Change a few instances of 'stat()' to use 'g_stat()' (for UTF8 compatibility on Windows)
Diffstat (limited to 'libs/ardour/utils.cc')
-rw-r--r--libs/ardour/utils.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc
index c66b34a2ba..9f44f78705 100644
--- a/libs/ardour/utils.cc
+++ b/libs/ardour/utils.cc
@@ -33,7 +33,6 @@
#include <cerrno>
#include <iostream>
#include <sys/types.h>
-#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
#ifndef COMPILER_MSVC
@@ -42,6 +41,8 @@
#include <errno.h>
#include <regex.h>
+#include <pbd/gstdio_compat.h>
+
#include <glibmm/miscutils.h>
#include <glibmm/fileutils.h>
@@ -662,11 +663,11 @@ ARDOUR::native_header_format_extension (HeaderFormat hf, const DataType& type)
bool
ARDOUR::matching_unsuffixed_filename_exists_in (const string& dir, const string& path)
{
- string bws = basename_nosuffix (path);
+ string bws = basename_nosuffix (path);
struct dirent* dentry;
- struct stat statbuf;
+ GStatBuf statbuf;
DIR* dead;
- bool ret = false;
+ bool ret = false;
if ((dead = ::opendir (dir.c_str())) == 0) {
error << string_compose (_("cannot open directory %1 (%2)"), dir, strerror (errno)) << endl;
@@ -684,7 +685,7 @@ ARDOUR::matching_unsuffixed_filename_exists_in (const string& dir, const string&
string fullpath = Glib::build_filename (dir, dentry->d_name);
- if (::stat (fullpath.c_str(), &statbuf)) {
+ if (g_stat (fullpath.c_str(), &statbuf)) {
continue;
}