diff options
author | Tor Egge <Tor.Egge@online.no> | 2023-07-20 14:30:37 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2023-07-20 14:30:37 +0200 |
commit | 39efedb76e481b4c84fec8b5960357b44c07b6ed (patch) | |
tree | 901bee82c607536f1a127618c40409893131f092 | |
parent | afe1a7626a75c2d1af6b147979c45536fe7bd14c (diff) |
Remove vespalib::pathExists, vespalib::isPlainFile and vespalib::isSymLink.
-rw-r--r-- | vespalib/src/tests/io/fileutil/fileutiltest.cpp | 2 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/io/fileutil.h | 34 |
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>; |