summaryrefslogtreecommitdiff
path: root/src/loadsave.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2017-06-13 18:24:42 +0200
committerBardur Arantsson <bardur@scientician.net>2017-06-13 18:24:42 +0200
commit1fb9b3961781e5bca533c6876615cb67d5a455b0 (patch)
treea0fe757628985473b6a2e7662eaa27c80fa574a7 /src/loadsave.cc
parent7a98afaeee09141ab36607e898d0e00072d9d930 (diff)
Use boost::fs::exists() instead of "homebaked" file_exist()
Diffstat (limited to 'src/loadsave.cc')
-rw-r--r--src/loadsave.cc24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/loadsave.cc b/src/loadsave.cc
index fc473e0c..541fbbec 100644
--- a/src/loadsave.cc
+++ b/src/loadsave.cc
@@ -38,6 +38,7 @@
#include "xtra2.hpp"
#include "z-rand.hpp"
+#include <boost/filesystem.hpp>
#include <cassert>
#include <fmt/format.h>
#include <memory>
@@ -1478,27 +1479,6 @@ void save_dungeon()
my_fclose(fff);
}
-bool_ file_exist(cptr buf)
-{
- int fd;
- bool_ result;
-
- /* Open savefile */
- fd = fd_open(buf, O_RDONLY);
-
- /* File exists */
- if (fd >= 0)
- {
- fd_close(fd);
- result = TRUE;
- }
- else
- result = FALSE;
-
- return result;
-}
-
-
/*
* Handle monster lore
*/
@@ -2540,7 +2520,7 @@ bool_ load_player()
/* XXX XXX XXX Fix this */
/* Verify the existance of the savefile */
- if (!file_exist(savefile))
+ if (!boost::filesystem::exists(savefile))
{
/* Give a message */
msg_format("Savefile does not exist: %s", savefile);