From e92e690b45149ce455ad336473cf530bfbb9c824 Mon Sep 17 00:00:00 2001 From: dongjulim Date: Mon, 18 Mar 2024 15:54:15 +0900 Subject: [PATCH] filesystem test --- filesystem_test.cpp | 211 +++++++++++++++++++++++++++++++++----------- 1 file changed, 161 insertions(+), 50 deletions(-) diff --git a/filesystem_test.cpp b/filesystem_test.cpp index d59ed3d..b9d0251 100644 --- a/filesystem_test.cpp +++ b/filesystem_test.cpp @@ -1,59 +1,170 @@ -// -// Created by centos on 24. 3. 15.. -// - -// -// Created by centos on 24. 3. 13.. -// -#include -#include "Poco/Foundation.h" -#include "Poco/TemporaryFile.h" +#include #include "Poco/Path.h" -#include "Poco/File.h" -#include "Poco/FileStream.h" -#include "Poco/TeeStream.h" -int file_path_test(); -int main() { - file_path_test(); -} +#include "Poco/Environment.h" +#include "Poco/Foundation.h" +#include "Poco/Glob.h" +#include +#include +#include + +void make_path(){ + std::cout<<"----------make path----------"< files; + tmpDir.list(files); + std::vector::iterator it = files.begin(); + for (; it != files.end(); ++it) + { + std::cout <<"\t"<< *it << std::endl; + } + tmpDir.remove(true); + std::cout<<"-------------------------"<> hello >> i; - reader.read7BitEncoded(i); - reader >> b; - return 0; +void glob_test(){ + std::cout<<"-------glob path test-------"< files; + if (POCO_OS==POCO_OS_WINDOWS_NT){ + Poco::Glob::glob("%WINDIR%\\system32\\*.exe", files); + } else { + Poco::Glob::glob("/usr/include/*/*.h", files); + } + Poco::File file(Poco::Path(Poco::Path::current(),std::string("glob_test.txt"))); + std::ofstream ostr(file.path().c_str()); + std::cout<<"checkout the result of Glob test for '"<::iterator it = files.begin(); + for (; it != files.end(); ++it) + { + ostr<<*it<