aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@yahooinc.com>2023-07-20 15:44:53 +0200
committerGitHub <noreply@github.com>2023-07-20 15:44:53 +0200
commit00c37c3d80017f062163e512696869787d06ff71 (patch)
treea2dc16a8b5dd203c8383433335f74d5e0c782634
parent69d40ce3c2b9ee06b9dab98d581c07f9fe9b2973 (diff)
parent39efedb76e481b4c84fec8b5960357b44c07b6ed (diff)
Merge pull request #27853 from vespa-engine/toregge/remove-vespalib-pathexists
Remove vespalib::pathExists, vespalib::isPlainFile and vespalib::isSy…
-rw-r--r--vespalib/src/tests/io/fileutil/fileutiltest.cpp2
-rw-r--r--vespalib/src/vespa/vespalib/io/fileutil.h34
2 files changed, 0 insertions, 36 deletions
diff --git a/vespalib/src/tests/io/fileutil/fileutiltest.cpp b/vespalib/src/tests/io/fileutil/fileutiltest.cpp
index 337c9052a66..f98ddd80de4 100644
--- a/vespalib/src/tests/io/fileutil/fileutiltest.cpp
+++ b/vespalib/src/tests/io/fileutil/fileutiltest.cpp
@@ -180,8 +180,6 @@ TEST("require that vespalib::File::stat works")
EXPECT_EQUAL(true, isDirectory("mydir"));
EXPECT_EQUAL(false, isDirectory("myfile"));
- EXPECT_EQUAL(false, isPlainFile("mydir"));
- EXPECT_EQUAL(true, isPlainFile("myfile"));
EXPECT_EQUAL(true, fileExists("myfile"));
EXPECT_EQUAL(true, fileExists("mydir"));
}
diff --git a/vespalib/src/vespa/vespalib/io/fileutil.h b/vespalib/src/vespa/vespalib/io/fileutil.h
index 6214bf3e60d..20711d10201 100644
--- a/vespalib/src/vespa/vespalib/io/fileutil.h
+++ b/vespalib/src/vespa/vespalib/io/fileutil.h
@@ -249,18 +249,6 @@ extern FileInfo::UP lstat(const vespalib::string & path);
extern bool fileExists(const vespalib::string & path);
/**
- * Check if a path exists, i.e. whether it's a symbolic link, regular file,
- * directory, etc.
- *
- * This function is the same as fileExists, except if path is a symbolic link:
- * This function returns true, while fileExists returns true only if the path
- * the symbolic link points to exists.
- */
-extern inline bool pathExists(const vespalib::string & path) {
- return (lstat(path).get() != 0);
-}
-
-/**
* Get the filesize of the given file. Ignoring if it exists or not.
* (None-existing files will be reported to have size zero)
*/
@@ -270,17 +258,6 @@ extern inline off_t getFileSize(const vespalib::string & path) {
}
/**
- * Check if a file is a plain file or not.
- *
- * @return True if it is a plain file, false if it don't exist or isn't.
- * @throw IoException If we failed to stat the file.
- */
-extern inline bool isPlainFile(const vespalib::string & path) {
- FileInfo::UP info(stat(path));
- return (info.get() && info->_plainfile);
-}
-
-/**
* Check if a file is a directory or not.
*
* @return True if it is a directory, false if it don't exist or isn't.
@@ -289,17 +266,6 @@ extern inline bool isPlainFile(const vespalib::string & path) {
extern bool isDirectory(const vespalib::string & path);
/**
- * Check whether a path is a symlink.
- *
- * @return True if path exists and is a symbolic link.
- * @throw IoException If there's an unexpected stat failure.
- */
-extern inline bool isSymLink(const vespalib::string & path) {
- FileInfo::UP info(lstat(path));
- return (info.get() && info->_symlink);
-}
-
-/**
* List the contents of the given directory.
*/
using DirectoryList = std::vector<vespalib::string>;