From 39efedb76e481b4c84fec8b5960357b44c07b6ed Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Thu, 20 Jul 2023 14:30:37 +0200 Subject: Remove vespalib::pathExists, vespalib::isPlainFile and vespalib::isSymLink. --- vespalib/src/tests/io/fileutil/fileutiltest.cpp | 2 -- vespalib/src/vespa/vespalib/io/fileutil.h | 34 ------------------------- 2 files changed, 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 @@ -248,18 +248,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) @@ -269,17 +257,6 @@ extern inline off_t getFileSize(const vespalib::string & path) { return (info.get() == 0 ? 0 : info->_size); } -/** - * 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. * @@ -288,17 +265,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. */ -- cgit v1.2.3