{"id":677,"date":"2018-12-06T16:24:24","date_gmt":"2018-12-06T16:24:24","guid":{"rendered":"https:\/\/yazilimperver.net\/?p=677"},"modified":"2019-02-05T19:27:31","modified_gmt":"2019-02-05T19:27:31","slug":"english-weekly-c-6-filesystem-library","status":"publish","type":"post","link":"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/","title":{"rendered":"[:tr]Haftal\u0131k C++ 6 &#8211; Dosya Sistemi K\u00fct\u00fcphanesi[:en]Weekly C++ 6 &#8211; Filesystem Library[:]"},"content":{"rendered":"<p>[:tr]Herkese merhabalar, bir aradan sonra (umar\u0131m \u00e7ok da uzun olmayan), yeni bir haftal\u0131k C++ yaz\u0131m\u0131z ile birlikteyiz. Bu yaz\u0131mda, sizler ile birlikte uzun bir s\u00fcre beklenen (asl\u0131nda Java ve .Net gibi bir \u00e7ok platform ile sunulan ama C++ da standart bir \u015fekilde sunulmayan) STL kabiliyeti olan, dosya sistemi k\u00fct\u00fcphanesine bir g\u00f6z ataca\u011f\u0131z.<\/p>\n<p>Bu k\u00fct\u00fcphane, asl\u0131nda uzunca bir s\u00fcredir (yakla\u015f\u0131k 2003) kullan\u0131lmakta olan <span style=\"color: #339966;\"><strong><a style=\"color: #339966;\" href=\"https:\/\/www.boost.org\/doc\/libs\/1_68_0\/libs\/filesystem\/doc\/index.htm\">boost::filesystem<\/a><\/strong><\/span> k\u00fct\u00fcphanesini baz al\u0131yor diyebiliriz. O k\u00fct\u00fcphane de olduk\u00e7a yayg\u0131n ve bir\u00e7ok ki\u015fi taraf\u0131ndan kullan\u0131l\u0131yor, ayr\u0131ca merak edenler i\u00e7in de \ud83d\ude09 boost ve standart dosya sistemi k\u00fct\u00fcphanelerini kar\u015f\u0131la\u015ft\u0131ran bir ba\u011flant\u0131 veriyorum. Elbette standart dosya sistemi k\u00fct\u00fcphanesinin en \u00f6nemli amac\u0131 sizin de tahmin edebilece\u011finiz \u00fczere bir \u00e7ok platform i\u00e7in standart kod yazabilmek. Bu yaz\u0131mda da, k\u00fct\u00fcphanenin \u00f6ne \u00e7\u0131kan \u00f6zellikleri \u00fczerinden ge\u00e7ip, bunlar\u0131 \u00f6rnek kullan\u0131mlarla sizlere aktarmaya \u00e7al\u0131\u015faca\u011f\u0131m. Bunun ile birlikte daha detayl\u0131 bilgi edinmek i\u00e7in de sizlere ilgili kaynaklar\u0131 sunaca\u011f\u0131m. Bu arada e\u011fer f\u0131rsat bulabilirsem, haz\u0131rlayaca\u011f\u0131m baz\u0131 haftal\u0131k C++ yaz\u0131lar\u0131nda bu k\u00fct\u00fcphanenin \u00f6rnek kullan\u0131mlar\u0131n\u0131 verebilirim.<\/p>\n<h2><span style=\"color: #0000ff;\"><strong>Giri\u015f:<\/strong><\/span><\/h2>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/48347642\/differences-between-c14-stdexperimentalfilesystemv1-and-c17-stdfiles\">Stackoverflow yaz\u0131s\u0131nda<\/a> ifade edildi\u011fi \u00fczere, bu k\u00fct\u00fcphaneye yap\u0131lan de\u011fi\u015fikliklere ili\u015fkin bir \u00e7ok yay\u0131n mevcut. Bunlara a\u015fa\u011f\u0131daki ba\u011flant\u0131lardan ula\u015fabilirsiniz:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2016\/p0219r1.html\"><span style=\"color: #339966;\"><strong>P0219R1<\/strong><\/span><\/a>, g\u00f6receli yol deste\u011fi eklenmesi,<\/li>\n<li><a href=\"https:\/\/wg21.link\/P0317R1\"><span style=\"color: #339966;\"><strong>P0317R1<\/strong><\/span><\/a>, directory_entry&#8217;ye \u00f6n bellek (cache) eklenmesi,<\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/wg21.link\/P0492R2\">P0492R2<\/a>,<\/span><\/strong> gelen g\u00f6r\u00fc\u015fler \u0131\u015f\u0131\u011f\u0131nda yap\u0131lan bir \u00e7ok hata ve g\u00fcncellemeler,<\/li>\n<li><a href=\"https:\/\/wg21.link\/P0492R2\"><strong><span style=\"color: #339966;\">P0430R2<\/span><\/strong><\/a>, baz\u0131 Non-POSIX sistemler i\u00e7in destek,<\/li>\n<li><a href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2016\/p0218r1.html\"><strong><span style=\"color: #339966;\">P0218R1<\/span><\/strong><\/a>, nihai yay\u0131n.<\/li>\n<\/ul>\n<p>K\u00fct\u00fcphaneye dair g\u00fcncellemeleri &#8220;<span style=\"color: #339966;\"><strong><a style=\"color: #339966;\" href=\"http:\/\/cplusplus.github.io\/LWG\/lwg-index.html#filesystems\">LWG issue list<\/a>&#8221;\u00a0<\/strong><\/span>listesinden takip edebilirsiniz. Ayr\u0131ca C++ standard\u0131n\u0131n di\u011fer par\u00e7alar\u0131na\/kabiliyetlere dair hususlar\u0131 da buradan takip edebilirsiniz.<\/p>\n<p>Ayr\u0131ca C++ <a href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2017\/n4659.pdf\">standart dok\u00fcman\u0131<\/a> i\u00e7erisindeki <strong>30.10<\/strong> ba\u015fl\u0131\u011f\u0131ndan da dosya sistemine dair detaylara ula\u015fabilirsiniz. Fakat dok\u00fcman\u0131n, olduk\u00e7a b\u00fcy\u00fck oldu\u011funu ifade etmeliyim \ud83d\ude42<\/p>\n<p>Yukar\u0131da da bahsetti\u011fim \u00fczere, k\u00fct\u00fcphane boost::filesystem&#8217;e dayan\u0131yor ve k\u00fct\u00fcphane taraf\u0131ndan sunulan baz\u0131 bile\u015fenler de opsiyonel. Bir di\u011fer deyi\u015fle her platform ya da derleyici ile kullan\u0131lmayabilir (\u00f6r. sembolik k\u0131sayollar FAT-32 de desteklenmemektedir). Bunlar\u0131n yan\u0131nda, a\u015fa\u011f\u0131da baz\u0131 platform (i\u015fletim sistemi) ile ilintili hususlar\u0131 da g\u00f6z \u00f6n\u00fcne alman\u0131zda fayda var:<\/p>\n<ul>\n<li><em><strong>Dosya karakter duyarl\u0131l\u0131\u011f\u0131.<\/strong><\/em> \u00d6r. &#8220;file.txt&#8221;, &#8220;File.txt&#8221; ve &#8220;filet.TXT&#8221; her ne kadar Windows tabanl\u0131 i\u015fletim sistemlerinde ayn\u0131 dosyaya kar\u015f\u0131l\u0131k gelse de Linux gibi POSIX tabanl\u0131 i\u015fletim sistemlerinde ise \u00fc\u00e7 farkl\u0131 dosyaya kar\u015f\u0131l\u0131k gelmektedir,<\/li>\n<li><em><strong>G\u00f6receli\/tam dosya yolu yakla\u015f\u0131mlar\u0131.<\/strong><\/em> POSIX benzeri sistemlerde &#8220;\/bin&#8221; dizini tam dosya dizinine kar\u015f\u0131l\u0131k gelse de, Windows tabanl\u0131 i\u015fletim sistemlerinde b\u00f6yle bir yakla\u015f\u0131m hi\u00e7 bulunmamaktad\u0131r,<\/li>\n<\/ul>\n<p>K\u00fct\u00fcphanedeki en \u00f6nemli kavram dosya\/dizin yolu (&#8220;path&#8221;). Bu asl\u0131nda herhangi bir dosyan\u0131n (ayn\u0131 zamanda dizinin) konumunu ifade eden etiket olarak nitelendirebiliriz. Tabi bu sadece dosya de\u011fil, ayn\u0131 zamanda <em><strong>dizin, k\u0131sa yol, kat\u0131 ba\u011flant\u0131 ya da sembolik ba\u011flant\u0131lar\u0131<\/strong> <\/em>da ifade edebilir. Yol kavram\u0131n\u0131n bu anlamda ifade edebilece\u011fi b\u00fct\u00fcn de\u011ferleri g\u00f6rmek i\u00e7in dosya sistemi k\u00fct\u00fcphanesi sayfas\u0131na bakabilirsiniz. Bu yollar g\u00f6receli ya da b\u00fct\u00fcn yolu ifade edebilir. Baz\u0131 platformlar\u0131n jenerik ya da kendilerine \u00f6zel yol formatlar\u0131 da olabiliyor. \u00d6r, Windows \u00fczerinde &#8220;\/tmp\/test.txt&#8221; ge\u00e7erli bir format olarak kabul ediliyor, &#8220;\\tmp\\test.txt&#8221; yolu da destekleniyor. Bu ikisi ayn\u0131 yolu ifade eden platforma \u00f6zg\u00fc g\u00f6sterimler. Bu tarz g\u00f6sterimler, platformlardan platforma de\u011fi\u015febilmekte. K\u00fct\u00fcphane bu tarz platform ba\u011f\u0131ml\u0131 dosya yolu ile daha jenerik g\u00f6sterimler aras\u0131nda d\u00f6n\u00fc\u015f\u00fcm i\u00e7in de API sunmakta.<\/p>\n<p>Bu do\u011frultuda bakacak olursak genel yol format\u0131 a\u015fa\u011f\u0131daki gibi \u00f6zetlenebilir:<\/p>\n<p>The generic path format can be summarized as:<br \/>\n<strong><span style=\"color: #ff0000;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 [rootname] [rootdir] [relativepath]<\/span><\/strong><br \/>\nwhere:<\/p>\n<ul>\n<li>Burada opsiyonel olan k\u00f6k ismi (&#8220;rootname&#8221;), platforma \u00f6zg\u00fcd\u00fcr (\u00f6r. POSIX sistemlerde &#8220;\/\/host&#8221;, Windows tabanl\u0131 sistemlerde &#8220;C:&#8221; olabilmektedir.),<\/li>\n<li>Bir di\u011fer opsiyonel \u00f6\u011fe k\u00f6k dizini de dizin ay\u0131rac\u0131 olarak kullan\u0131l\u0131yor,<\/li>\n<li>Son olarak g\u00f6receli yol ise dosya ve dizin isimlerini i\u00e7eren k\u0131s\u0131md\u0131r.<\/li>\n<\/ul>\n<p>Sizin de tahmin edebilece\u011finiz \u00fczere dosya sistemi k\u00fct\u00fcphanesi olduk\u00e7a b\u00fcy\u00fck bir k\u00fct\u00fcphane ve b\u00fct\u00fcn detaylar\u0131n\u0131 bir yaz\u0131da vermek olduk\u00e7a zor. Burada olabildi\u011fince \u00f6nemli olan kabiliyetlerin \u00fczerinde durup, daha \u00e7ok pratik kullan\u0131m alan\u0131 olan \u00f6zelliklerini \u00f6rnek kodlar ile vermeye \u00e7al\u0131\u015faca\u011f\u0131m. Daha fazla detay \u00f6\u011frenmek isterseniz, sizlere kaynaklar k\u0131sm\u0131ndaki Nicolai. M. Jouttis ve di\u011fer C++ 17 kitaplar\u0131n\u0131 \u00f6nerebilirim.<\/p>\n<p>Dosya sistemi k\u00fct\u00fcphanesini kullanmak i\u00e7in\u00a0<em><strong>&lt;filesystem&gt;\u00a0<\/strong><\/em>ba\u015fl\u0131k dosyas\u0131n\u0131 eklemeli ve <em><strong>filesystem::<\/strong><\/em> alan\u0131n\u0131 kullanmal\u0131s\u0131n\u0131z. K\u00fct\u00fcphane i\u00e7erisinde hem s\u0131n\u0131flar hem de ba\u011f\u0131ms\u0131z metot \u015feklinde API&#8217;ler bulunmakta. Varsay\u0131lan olarak, k\u00fct\u00fcphane hatalar\u0131 istisna mekanizmas\u0131 (<strong>filesystem_error<\/strong> istisna nesnesi) ile kotar\u0131yor (di\u011fer k\u00fct\u00fcphanelere g\u00f6re do\u011fas\u0131 gere\u011fi bu tarz durumlar\u0131n \u00e7ok olabilece\u011fini tahmin edersiniz diye d\u00fc\u015f\u00fcn\u00fcyorum). \u0130stisna mekanizmas\u0131 yan\u0131nda isterseniz, ilgili hata kodlar\u0131n\u0131 da parametre olarak d\u00f6nen API&#8217;leri kullanabilirsiniz (<strong>std::error_code<\/strong>).<\/p>\n<p>\u0130lgili alan uzay\u0131 ve ba\u015fl\u0131k dosyas\u0131 derleyici ve IDE&#8217;nize g\u00f6re de\u011fi\u015fiklik g\u00f6sterebilir, bu konuya son ba\u015fl\u0131kta (derleyici deste\u011fi) de\u011finece\u011fim.<\/p>\n<p>Bu kadar a\u00e7\u0131klama yeter san\u0131r\u0131m, hemen bir \u00f6rnek ile k\u00fct\u00fcphaneyi kullanmaya ba\u015flayal\u0131m:<\/p>\n<pre class=\"minimize:true lang:c++ decode:true\">#include &lt;fstream&gt;\r\n#include &lt;iostream&gt;\r\n#include &lt;string&gt;\r\n#include &lt;experimental\/filesystem&gt;\r\nnamespace fs = std::experimental::filesystem;\r\n\r\nint main()\r\n{\r\n\t\/\/\/ current_path metodu uygulaman\u0131n \u00e7al\u0131\u015fd\u0131\u011f\u0131 dizin\r\n\tstd::cout &lt;&lt; \"Current path: \" &lt;&lt; fs::current_path() &lt;&lt; std::endl;\r\n\r\n\t\/\/\/ \"sandbox\/a\/b\" dizinlerini olustur\r\n\tstd::string dir = \"sandbox\/a\/b\";\r\n\tfs::create_directories(dir);\r\n\r\n\tstd::ofstream(\"sandbox\/file1.txt\");\r\n\r\n\t\/\/ Sembolik ba\u011flant\u0131lar Windows'ta olmad\u0131\u011f\u0131 i\u00e7in a\u015fa\u011f\u0131daki gibi koruma alt\u0131na al\u0131yoruz.\r\n#ifndef WIN32\r\n\tfs::path symPath = fs::current_path() \/= \"sandbox\";\r\n\tsymPath \/= \"syma\";\r\n\tfs::create_symlink(\"a\", \"symPath\");\r\n\tstd::cout &lt;&lt; \"fs::symlink(symPath): \" &lt;&lt; fs::is_symlink(symPath) &lt;&lt; std::endl;\r\n\tstd::cout &lt;&lt; \"fs::exists(symPath): \" &lt;&lt; fs::exists(symPath) &lt;&lt; std::endl;\r\n#endif\r\n\r\n\tstd::cout &lt;&lt; \"fs::is_directory(dir): \" &lt;&lt; fs::is_directory(dir) &lt;&lt; std::endl;\t\r\n\r\n\t\/\/ Dizin i\u00e7eri\u011fini \u00f6zyineli bir \u015fekilde g\u00f6sterelim\r\n\tfor (auto&amp; p : fs::recursive_directory_iterator(\"sandbox\"))\r\n\t\tstd::cout &lt;&lt; p &lt;&lt; std::endl;\r\n\t\r\n\t\/\/ k\u00f6k dizin ve alt\u0131ndaki b\u00fct\u00fcn her \u015feyi silelim\r\n\tfs::remove_all(\"sandbox\");\r\n\r\n\treturn 0;\r\n}<\/pre>\n<p>Yukar\u0131da g\u00f6rebilece\u011finiz \u00fczere dizin i\u015flemlerini sunulan bu API&#8217;ler ile kolay bir \u015fekilde ger\u00e7ekle\u015ftirebilirsiniz. Peki daha ba\u015fka neler yapabiliriz:<\/p>\n<ul>\n<li>Dizin olu\u015fturma\/i\u00e7eri\u011fini izleme,<\/li>\n<li>Dizin d\u00fczenlemeleri ve kar\u015f\u0131la\u015ft\u0131rma,<\/li>\n<li>Dizin isimlerinin platform \u00f6zg\u00fc ve jenerik d\u00f6n\u00fc\u015f\u00fcmleri<\/li>\n<li>Dizin ve dosyalar aras\u0131nda dola\u015fma,<\/li>\n<li>Dosya niteliklerini, durumunu ve yetkileri izleme\/de\u011fi\u015ftirme,<\/li>\n<li>Dosya i\u015flemleri (olu\u015fturma, silme, kopyalama, ta\u015f\u0131ma),<\/li>\n<li>\u00c7ok daha fazlas\u0131 i\u00e7in<a href=\"https:\/\/en.cppreference.com\/w\/cpp\/filesystem\"><strong><span style=\"color: #339966;\">\u00a0https:\/\/en.cppreference.com\/w\/cpp\/filesystem<\/span><\/strong><\/a>\u00a0sayfas\u0131na bir g\u00f6z atabilirsiniz<\/li>\n<\/ul>\n<h2><span style=\"color: #0000ff;\"><strong>Yol Nesneleri:<\/strong><\/span><\/h2>\n<p>\u015eimdi en \u00e7ok kullan\u0131lan nesnelerden birisi olan yol nesnelerine g\u00f6z atal\u0131m. Asl\u0131nda bakarsan\u0131z a\u015fa\u011f\u0131daki \u00f6rnek bu s\u0131n\u0131fa ili\u015fkin \u00e7o\u011fu \u00f6rnek kullan\u0131m\u0131 g\u00f6stermekte. Bunlar\u0131n bir \u00e7o\u011fu g\u00fcnl\u00fck kullan\u0131mda ihtiya\u00e7 duyabilece\u011finiz kabiliyetler. Hemen bakal\u0131m.<\/p>\n<pre class=\"lang:c++ decode:true\">#include &lt;fstream&gt;\r\n#include &lt;iostream&gt;\r\n#include &lt;string&gt;\r\n#include &lt;time.h&gt;\r\n#include &lt;filesystem&gt;\r\nusing namespace std;\r\nnamespace fs = std::experimental::filesystem;\r\n\r\n\/\/ \u0130lgili yolu yukar\u0131da bahsetti\u011fim \u015fekilde par\u00e7a par\u00e7a g\u00f6stermek i\u00e7in kullan\u0131lan metot. \r\n\/\/ G\u00f6rebilece\u011finiz \u00fczere asl\u0131nda yol nesnesinin kendisi de bir konteyner\r\nvoid iteratePathContent(const fs::path&amp; initialPath)\r\n{\r\n\tint i = 0;\r\n\r\n\tfor (const auto&amp; part : initialPath)\r\n\t\tcout &lt;&lt; \"Path part: \" &lt;&lt; i++ &lt;&lt; \" = \" &lt;&lt; part &lt;&lt; '\\n';\r\n}\r\n\r\n\r\n\/\/ Verilen dosyan\u0131n boyutunu hesaplayan metot\r\n\/\/ Hata durumunda -1 d\u00f6ner\r\nuintmax_t calculateFileSize(const fs::path&amp; filePath)\r\n{\r\n\t\/\/ uintmax_t =&gt; en geni\u015f i\u015faretsiz tam say\u0131\r\n\tuintmax_t totalSize = static_cast&lt;uintmax_t&gt;(-1);\r\n\r\n\tif (fs::exists(filePath) &amp;&amp; fs::is_regular_file(filePath))\r\n\t{\r\n\t\tauto err = error_code{};\r\n\t\tauto filesize = fs::file_size(filePath, err);\r\n\r\n\t\tif (filesize != static_cast&lt;uintmax_t&gt;(-1))\r\n\t\t{\r\n\t\t\ttotalSize = filesize;\r\n\t\t}\r\n\t}\r\n\r\n\treturn totalSize;\r\n}\r\n\r\n\/\/ Verilen dizinin boyutunu hesaplayan metot\r\n\/\/ Hata durumunda -1 d\u00f6ner\r\nuintmax_t calculateDirectorySize(const fs::path&amp; pathToCheck)\r\n{\r\n\tauto size = static_cast&lt;uintmax_t&gt;(-1);\r\n\tif (fs::exists(pathToCheck) &amp;&amp; fs::is_directory(pathToCheck))\r\n\t{\r\n\t\tfor (auto const &amp; entry : fs::recursive_directory_iterator(pathToCheck))\r\n\t\t{\r\n\t\t\tif (fs::is_regular_file(entry.status()) || fs::is_symlink(entry.status()))\r\n\t\t\t{\r\n\t\t\t\tauto err = error_code{};\r\n\t\t\t\tauto filesize = fs::file_size(entry, err);\r\n\t\t\t\tif (filesize != static_cast&lt;uintmax_t&gt;(-1) &amp;&amp; err != error_code())\r\n\t\t\t\t\tsize += filesize;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn size;\r\n}\r\n\r\n\/\/ Verilen yol nesnesine ili\u015fkin bilgileri sunan metot\r\nvoid displayPathInfo(const fs::path&amp; pathToShow)\r\n{\r\n\tint i = 0;\r\n\tcout &lt;&lt; \"Displaying path info for: \" &lt;&lt; pathToShow &lt;&lt; '\\n';\r\n\tfor (const auto&amp; part : pathToShow)\r\n\t{\r\n\t\tcout &lt;&lt; \"path part: \" &lt;&lt; i++ &lt;&lt; \" = \" &lt;&lt; part &lt;&lt; '\\n';\r\n\t}\r\n\r\n\ttry\r\n\t{\r\n\t\tcout &lt;&lt; \"exists() = \" &lt;&lt; fs::exists(pathToShow) &lt;&lt; '\\n'\r\n\t\t\t&lt;&lt; \"root_name() = \" &lt;&lt; pathToShow.root_name() &lt;&lt; '\\n'\r\n\t\t\t&lt;&lt; \"root_path() = \" &lt;&lt; pathToShow.root_path() &lt;&lt; '\\n'\r\n\t\t\t&lt;&lt; \"relative_path() = \" &lt;&lt; pathToShow.relative_path() &lt;&lt; '\\n'\r\n\t\t\t&lt;&lt; \"parent_path() = \" &lt;&lt; pathToShow.parent_path() &lt;&lt; '\\n'\r\n\t\t\t&lt;&lt; \"filename() = \" &lt;&lt; pathToShow.filename() &lt;&lt; '\\n'\r\n\t\t\t&lt;&lt; \"stem() = \" &lt;&lt; pathToShow.stem() &lt;&lt; '\\n'\r\n\t\t\t&lt;&lt; \"extension() = \" &lt;&lt; pathToShow.extension() &lt;&lt; '\\n';\r\n\r\n\t\tcout &lt;&lt; \"canonical() = \" &lt;&lt; fs::canonical(pathToShow) &lt;&lt; '\\n';\r\n\t}\r\n\tcatch (fs::filesystem_error err)\r\n\t{\r\n\t\tcout &lt;&lt; \"exception: \" &lt;&lt; err.what() &lt;&lt; '\\n';\r\n\t}\r\n}\r\n\r\n\/\/ Dosya ismi, yolu, boyutu ve en son d\u00fczenlenme tarihini g\u00f6steren metot\r\nvoid displayFileInfo(const fs::directory_entry &amp; entry, string &amp;lead, fs::path &amp;filename)\r\n{\r\n\ttime_t cftime = chrono::system_clock::to_time_t(fs::last_write_time(entry));\r\n\t\r\n\t\/\/ _s siz asctime API sini de kullanabilirsiniz\r\n\tchar timeStr[26];\r\n\tasctime_s(timeStr, sizeof timeStr, localtime(&amp;cftime));\r\n\r\n\tcout &lt;&lt; lead &lt;&lt; \" \" &lt;&lt; filename &lt;&lt; \", \"\r\n\t\t&lt;&lt; calculateFileSize(filename.c_str())\r\n\t\t&lt;&lt; \", time: \" &lt;&lt; timeStr;\r\n}\r\n\r\n\/\/ Verilen yol i\u00e7eri\u011finin \u00f6zyineli bir \u015fekilde g\u00f6sterilmesi\r\nvoid traverseAndDisplayFolderTree(const fs::path&amp; pathToShow, int level)\r\n{\r\n\tif (fs::exists(pathToShow) &amp;&amp; fs::is_directory(pathToShow))\r\n\t{\r\n\t\tauto lead = string(level * 3, ' ');\r\n\t\tfor (const auto&amp; entry : fs::directory_iterator(pathToShow))\r\n\t\t{\r\n\t\t\tauto filename = entry.path().filename();\r\n\t\t\tif (fs::is_directory(entry.status()))\r\n\t\t\t{\r\n\t\t\t\tcout &lt;&lt; lead &lt;&lt; \"[+] \" &lt;&lt; filename &lt;&lt; '\\n';\r\n\t\t\t\ttraverseAndDisplayFolderTree(entry, level + 1);\r\n\t\t\t\tcout &lt;&lt; '\\n';\r\n\t\t\t}\r\n\t\t\telse if (fs::is_regular_file(entry.status()))\r\n\t\t\t\tdisplayFileInfo(entry, lead, filename);\r\n\t\t\telse\r\n\t\t\t\tcout &lt;&lt; lead &lt;&lt; \" [?]\" &lt;&lt; filename &lt;&lt; '\\n';\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\/\/ Yukar\u0131daki dizinlerin \u00f6zyineli bir \u015fekilde g\u00f6sterilmesinin ilklendirilmesinde kullan\u0131lan metot\r\nvoid traverseAndDisplayFolderTree(const fs::path&amp; initialPath)\r\n{\r\n\ttraverseAndDisplayFolderTree(initialPath, 0);\r\n}\r\n\r\nint main(int argc, char* argv[])\r\n{\r\n\t\/\/ yol nesnesi ile  \/= and += operat\u00f6rlerini kullanabilirsiniz. \u0130lki yol format\u0131na uygun bir \u015fekilde ilgili metni ekler, ikincisi ise direk ekler\r\n\tfs::path examplePath(\"C:\\\\\");\r\n\texamplePath \/= \"Windows\";\r\n\texamplePath \/= \"System\";\r\n\r\n\tcout &lt;&lt; examplePath &lt;&lt; '\\n';\r\n\texamplePath += \"32\";\r\n\tcout &lt;&lt; examplePath &lt;&lt; '\\n';\r\n\r\n\t\/\/ Verilen yola ili\u015fkin bilgileri d\u00f6ner\r\n\tdisplayPathInfo(\"C:\\\\windows\\\\system.ini\");\r\n\r\n\t\/\/ Verilen yol i\u00e7eri\u011fini \u00f6zyineli bir \u015fekilde g\u00f6ster\r\n\titeratePathContent(\"C:\\\\windows\\\\system.ini\");\r\n\r\n\t\/\/ Verilen dizin i\u00e7eri\u011fini \u00f6z yineli bir \u015fekilde g\u00f6ster\r\n\tconst fs::path pathToShow{ argc &gt;= 2 ? argv[1] : fs::current_path() };\r\n\r\n\ttraverseAndDisplayFolderTree(pathToShow);\r\n\r\n\treturn 0;\r\n}<\/pre>\n<h2><strong><span style=\"color: #0000ff;\">Bo\u015f Disk Alan\u0131 Bilgisi:<\/span><\/strong><\/h2>\n<p>Bir di\u011fer kullan\u0131\u015fl\u0131 s\u0131n\u0131f ise <strong>std::filesystem::space_info<\/strong>. Bu s\u0131n\u0131f sayesinde dosya sistemine ili\u015fkin bo\u015f ve kullan\u0131labilir alan bilgileri a\u015fa\u011f\u0131da g\u00f6sterildi\u011fi \u015fekilde sorgulanabilir:<\/p>\n<pre class=\"lang:c++ decode:true\">#include &lt;iostream&gt;\r\n#include &lt;filesystem&gt;\r\nusing namespace std;\r\nnamespace fs = std::experimental::filesystem;\r\n\r\nint main()\r\n{\r\n\tfs::space_info devi = fs::space(\"\/windows\/system32\");\r\n\tfs::space_info tmpi = fs::space(\"C:\\\\\");\r\n\r\n\tcout &lt;&lt; \".                        Capacity       Free      Available\\n\"\r\n\t     &lt;&lt; \"\/windows\/system32:   \" &lt;&lt; devi.capacity &lt;&lt; \"   \"\r\n\t     &lt;&lt; devi.free &lt;&lt; \"   \" &lt;&lt; devi.available &lt;&lt; '\\n'\r\n\t     &lt;&lt; \"\/tmp:                \" &lt;&lt; tmpi.capacity &lt;&lt; \"   \"\r\n             &lt;&lt; tmpi.free &lt;&lt; \"   \" &lt;&lt; tmpi.available &lt;&lt; '\\n';\r\n}<\/pre>\n<h2><span style=\"color: #0000ff;\"><strong>\u0130zinler:<\/strong><\/span><\/h2>\n<p>A\u015fa\u011f\u0131da g\u00f6sterildi\u011fi \u015fekilde dosyalar\u0131n izin nitelikleri ile de oynayabilirsiniz. Bu anlamda <span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/en.cppreference.com\/w\/cpp\/named_req\/BitmaskType\"><strong>BitmaskType<\/strong><\/a><\/span>tipinde olan <strong>std::filesystem::perms<\/strong> maskeleri kullan\u0131lmakta (detaylar i\u00e7in https:\/\/en.cppreference.com\/w\/cpp\/filesystem\/perms)&#8217;a g\u00f6z atabilirsiniz). A\u015fa\u011f\u0131da ilgili izinleri nas\u0131l g\u00f6r\u00fcnt\u00fcleyip, de\u011fi\u015ftirebilece\u011finizi bulabilirsiniz:<\/p>\n<pre class=\"lang:c++ decode:true\">#include &lt;fstream&gt;\r\n#include &lt;bitset&gt;\r\n#include &lt;iostream&gt;\r\n#include &lt;filesystem&gt;\r\nnamespace fs = std::experimental::filesystem;\r\nusing namespace std;\r\n\r\nvoid displayPermissions(fs::perms p)\r\n{\r\n\tcout &lt;&lt; ((p &amp; fs::perms::owner_read) != fs::perms::none ? \"r\" : \"-\")\r\n\t\t&lt;&lt; ((p &amp; fs::perms::owner_write) != fs::perms::none ? \"w\" : \"-\")\r\n\t\t&lt;&lt; ((p &amp; fs::perms::owner_exec) != fs::perms::none ? \"x\" : \"-\")\r\n\t\t&lt;&lt; ((p &amp; fs::perms::group_read) != fs::perms::none ? \"r\" : \"-\")\r\n\t\t&lt;&lt; ((p &amp; fs::perms::group_write) != fs::perms::none ? \"w\" : \"-\")\r\n\t\t&lt;&lt; ((p &amp; fs::perms::group_exec) != fs::perms::none ? \"x\" : \"-\")\r\n\t\t&lt;&lt; ((p &amp; fs::perms::others_read) != fs::perms::none ? \"r\" : \"-\")\r\n\t\t&lt;&lt; ((p &amp; fs::perms::others_write) != fs::perms::none ? \"w\" : \"-\")\r\n\t\t&lt;&lt; ((p &amp; fs::perms::others_exec) != fs::perms::none ? \"x\" : \"-\")\r\n\t\t&lt;&lt; '\\n';\r\n}\r\n\r\nint main()\r\n{\r\n\t\/\/ Dosya olu\u015ftur\r\n\tofstream(\"test.txt\"); \r\n\r\n\tcout &lt;&lt; \"Created file with permissions: \";\r\n\tdisplayPermissions(fs::status(\"test.txt\").permissions());\r\n\r\n\t\/\/ \u0130zinleri de\u011fi\u015ftir\r\n\tfs::permissions(\"test.txt\",\r\n\t\tfs::perms::owner_all | fs::perms::group_all |\r\n\t\tfs::perms::add_perms);\r\n\r\n\tcout &lt;&lt; \"After adding o+rwx and g+rwx:  \";\r\n\tdisplayPermissions(fs::status(\"test.txt\").permissions());\r\n\r\n\t\/\/ Dosyay\u0131 sil\r\n\tfs::remove(\"test.txt\");\r\n}<\/pre>\n<h2><strong><span style=\"color: #0000ff;\">Son D\u00fczenleme Zaman\u0131:<\/span><\/strong><\/h2>\n<p>Bu k\u00fct\u00fcphane ve <strong>std::chrono<\/strong> k\u00fct\u00fcphanesini de kullanarak herhangi bir dosyan\u0131n son d\u00fczenlenme tarihini g\u00f6rebilirsiniz. A\u015fa\u011f\u0131daki \u00f6rnek kod, bu kullan\u0131m\u0131 g\u00f6stermekte:<\/p>\n<pre class=\"lang:c++ decode:true\">#include &lt;iostream&gt;\r\n#include &lt;chrono&gt;\r\n#include &lt;fstream&gt;\r\n#include &lt;filesystem&gt;\r\n\r\nnamespace fs = std::experimental::filesystem;\r\nusing namespace std::chrono_literals;\r\nusing namespace std;\r\n\r\nint main()\r\n{\r\n\t\/\/ Bir yol tan\u0131mlayal\u0131m\r\n\tfs::path path = fs::current_path() \/ \"example.txt\";\r\n\r\n\t\/\/ Dosya olu\u015ftur\r\n\tofstream exampleFile(path.c_str());\r\n\texampleFile.close();\r\n\r\n\t\/\/ Son yazma zaman\u0131n\u0131 oku\r\n\tauto ftime = fs::last_write_time(path);\r\n\r\n\ttime_t cftime = chrono::system_clock::to_time_t(ftime);\r\n\tcout &lt;&lt; \"File write time is \" &lt;&lt; asctime(localtime(&amp;cftime)) &lt;&lt; '\\n';\r\n\r\n\t\/\/ Dosya zaman\u0131n\u0131 3 saat ileri alal\u0131m\r\n\tfs::last_write_time(path, ftime + 3h);\r\n\r\n\t\/\/ Dosya zaman\u0131n\u0131 tekrar okuyal\u0131m\r\n\tftime = fs::last_write_time(path);\r\n\r\n\tcftime = chrono::system_clock::to_time_t(ftime);\r\n\r\n\t\/\/ TR zaman\u0131\r\n\tcout &lt;&lt; \"File write time is \" &lt;&lt; asctime(localtime(&amp;cftime)) &lt;&lt; endl;\r\n\r\n\t\/\/ Dosyay\u0131 silelim\r\n\tfs::remove(path);\r\n\r\n\treturn 0;\r\n}<\/pre>\n<h2><strong><span style=\"color: #0000ff;\">Derleyici\/K\u00fct\u00fcphane Deste\u011fi:<\/span><\/strong><\/h2>\n<p>Kulland\u0131\u011f\u0131n\u0131z derleyicinin bu kabiliyeti destekleyip desteklemedi\u011fini, di\u011fer kabiliyetler ile birlikte\u00a0<strong><a href=\"https:\/\/en.cppreference.com\/w\/cpp\/compiler_support.\"><span style=\"color: #339966;\">https:\/\/en.cppreference.com\/w\/cpp\/compiler_support<\/span><\/a><\/strong> adresinden kontrol edebilirsiniz.<br \/>\nDerleyicinizin s\u00fcr\u00fcm\u00fcne g\u00f6re <strong>std::experimental::filesystem<\/strong> isim alan\u0131 kullanman\u0131z gerekebilir.<\/p>\n<p><strong>GCC<\/strong>: &#8220;<em>-lstdc++fs<\/em>&#8221; opsyionu eklenmelidir. Ayr\u0131ca &#8220;&lt;experimental\/filesystem&gt;&#8221; ba\u015fl\u0131\u011f\u0131n\u0131 eklemeniz gerekiyor.<br \/>\n<strong>Clang: <\/strong>Clang 5.0 ile destek sunuluyor. <strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/libcxx.llvm.org\/cxx1z_status.html\">https:\/\/libcxx.llvm.org\/cxx1z_status.html<\/a><\/span><\/strong><br \/>\n<strong>Visual Studio<\/strong>: Visual studio 2017 i\u00e7in ise <em><strong>&lt;filesystem&gt;<\/strong><\/em> ba\u015fl\u0131\u011f\u0131n\u0131 ekleyip, <em><strong>std::experimental::filesystem<\/strong><\/em> isim alan\u0131n\u0131 kullanmal\u0131s\u0131n\u0131z (yukar\u0131daki \u00f6rnekler de bu \u015fekilde).<\/p>\n<h2><strong><span style=\"color: #0000ff;\">Kaynaklar:<\/span><\/strong><\/h2>\n<ul>\n<li><a href=\"http:\/\/www.modernescpp.com\/index.php\/c-17-more-details-about-the-library\"><strong><span style=\"color: #339966;\">http:\/\/www.modernescpp.com\/index.php\/c-17-more-details-about-the-library<\/span><\/strong><\/a><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/en.cppreference.com\/w\/cpp\/experimental\/fs\">https:\/\/en.cppreference.com\/w\/cpp\/experimental\/fs<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2014\/n4100.pdf\">http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2014\/n4100.pdf<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2017\/n4659.pdf\">http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2017\/n4659.pdf<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/stackoverflow.com\/questions\/48347642\/differences-between-c14-stdexperimentalfilesystemv1-and-c17-stdfiles\">https:\/\/stackoverflow.com\/questions\/48347642\/differences-between-c14-stdexperimentalfilesystemv1-and-c17-stdfiles<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/www.packtpub.com\/application-development\/c17-stl-cookbook\">https:\/\/www.packtpub.com\/application-development\/c17-stl-cookbook<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/www.amazon.com\/Modern-Programming-Cookbook-multithreading-networking\/dp\/1786465183\">https:\/\/www.amazon.com\/Modern-Programming-Cookbook-multithreading-networking\/dp\/1786465183<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"http:\/\/www.cppstd17.com\/\">http:\/\/www.cppstd17.com\/<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/stackoverflow.com\/questions\/40899267\/how-similar-are-boost-filesystem-and-the-standard-c-filesystem-libraries\">https:\/\/stackoverflow.com\/questions\/40899267\/how-similar-are-boost-filesystem-and-the-standard-c-filesystem-libraries<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/www.boost.org\/doc\/libs\/1_68_0\/libs\/filesystem\/doc\/index.htm\">https:\/\/www.boost.org\/doc\/libs\/1_68_0\/libs\/filesystem\/doc\/index.htm<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/en.cppreference.com\/w\/cpp\/compiler_support\">https:\/\/en.cppreference.com\/w\/cpp\/compiler_support<\/a><\/span><\/strong><\/li>\n<\/ul>\n<p>[:en]Hello everybody, after a break (hopefully not very long), we are together again with another weekly C++ post. In this post, we are going to explore a very anticipated standard library feature which is filesystem library (Well Java and .Net have this feature for a very long time why not us).<br \/>\nThis library is based on <span style=\"color: #339966;\"><strong><a style=\"color: #339966;\" href=\"https:\/\/www.boost.org\/doc\/libs\/1_68_0\/libs\/filesystem\/doc\/index.htm\">boost::filesystem<\/a><\/strong><\/span> which is available for a long time (since 2003) so if you would like to use that path well you can (I also added a link for comparison of boost and std version comparison for curious;). The most obvious benefit of this library as you may guess is to write multiplatform and standard code. In this post, we will go over most obvious features of library, and illustrate the possible usage via examples and provide references for more details. I may provide some example usage of this library in following posts.<\/p>\n<h2><span style=\"color: #0000ff;\"><strong>Overview:<\/strong><\/span><\/h2>\n<p>As pointed out in <a href=\"https:\/\/stackoverflow.com\/questions\/48347642\/differences-between-c14-stdexperimentalfilesystemv1-and-c17-stdfiles\"><strong><span style=\"color: #339966;\">Stackoverflow<\/span> <span style=\"color: #339966;\">Post<\/span><\/strong><\/a>, there are some papers making changes to current filesystem library which are listed as follow:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2016\/p0219r1.html\"><span style=\"color: #339966;\"><strong>P0219R1<\/strong><\/span><\/a>, adding relative paths support,<\/li>\n<li><a href=\"https:\/\/wg21.link\/P0317R1\"><span style=\"color: #339966;\"><strong>P0317R1<\/strong><\/span><\/a>, adding caching to directory_entry,<\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/wg21.link\/P0492R2\">P0492R2<\/a>,<\/span><\/strong> a lengthy list of fixes and changes in response to national body comments,<\/li>\n<li><a href=\"https:\/\/wg21.link\/P0492R2\"><strong><span style=\"color: #339966;\">P0430R2<\/span><\/strong><\/a>, support for certain non-POSIX systems,<\/li>\n<li><a href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2016\/p0218r1.html\"><strong><span style=\"color: #339966;\">P0218R1<\/span><\/strong><\/a>, final paper.<\/li>\n<\/ul>\n<p>In fact, the latest status can be observed via in the <span style=\"color: #339966;\"><strong><a style=\"color: #339966;\" href=\"http:\/\/cplusplus.github.io\/LWG\/lwg-index.html#filesystems\">LWG issue list<\/a><\/strong><\/span>. You can check out other capabilities&#8217; status.<\/p>\n<p>You can also check out <span style=\"color: #339966;\"><strong><a style=\"color: #339966;\" href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2017\/n4659.pdf\">the complete standard<\/a><\/strong><\/span> in which filesystems are explained under <strong>section 30.10<\/strong> (input\/output library). Beware that, this document is little bit large:)<\/p>\n<p>Well as I mentioned above, library is based on boost::filesystem and some of its components are optional which means that you may not use every feature on every platform or compiler (i.e. symbolic links are not supported in FAT-32). You also need to take some platform specific issues into consideration such as:<\/p>\n<ul>\n<li><em><strong>File name case sensivity<\/strong>. <\/em>For instance, &#8220;file.txt&#8221; and &#8220;File.txt&#8221; and &#8220;file.TXT&#8221; might refer to the same file in Windows OS or three different files POSIX-based OS like Linux,<\/li>\n<li><em><strong>Absolute\/relative path approach.<\/strong> <\/em>On some systems &#8220;\/bin&#8221; is an absolute path in POSIX-based OS es, while on others it is not Windows OS.<\/li>\n<\/ul>\n<p>The most important concepts of this library is <em>path<\/em>. It is a label which possibly represents a location of a file within system which may not be of course a file. It may represent <strong><em>folders, hard links, symbolic links or regular files (standard files).\u00a0<\/em><\/strong>You can check the web site of filesystem library for all enumerations. Paths on the other hand can be absolute or relative. Some platforms may have <em>generic\/native<\/em> path formats. On Windows OS, the generic format &#8220;<em>\/tmp\/test.txt<\/em>&#8221; is a valid native format besides &#8220;<em>\\tmp\\test.txt<\/em>&#8220;, which is also supported (thus, &#8220;<em>\/tmp\/test.txt<\/em>&#8221; and &#8220;<em>\\tmp\\test.txt<\/em>&#8221; are two native versions of the same path). Of course, library provides APIs to convert paths between the native and generic format.<\/p>\n<p>The generic path format can be summarized as:<br \/>\n<strong><span style=\"color: #ff0000;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 [rootname] [rootdir] [relativepath]<\/span><\/strong><br \/>\nwhere:<\/p>\n<ul>\n<li>The optional root name is implementation specific (e.g., it can be &#8220;\/\/host&#8221; on POSIX systems and &#8220;C:&#8221; on Windows systems),<\/li>\n<li>The optional root directory is a directory separator,<\/li>\n<li>The relative path is a sequence of file names separated by directory separators.<\/li>\n<\/ul>\n<p>Filesystem library is a very large library which is not in fact possible to cover each detail in this post so I will try to focus on most important and practical features through code examples. If you want to learn more details, I highly recommend Nicolai M. Josuttis and other C++ 17 books that I give in references which cover filesystems in a more detailed fashion.<\/p>\n<p>The filesystem library is provided through <em><strong>&lt;filesystem&gt;<\/strong><\/em> and filesystem namespace. There are both classes and freestanding functions in library. By default, library handles errors (which may occur more than other libraries because of its nature) through exceptions (<strong>filesystem_error<\/strong> exception), however you can also get error code (<strong>std::error_code<\/strong>) if you pass an additional parameter to corresponding API (in addition to return value).<\/p>\n<p>The namespace and include header may change according to you compiler, please check last section and you compiler support page for details.<\/p>\n<p>Let&#8217;s start to look at file system library with a simple example:<\/p>\n<pre class=\"minimize:true lang:c++ decode:true \">#include &lt;fstream&gt;\r\n#include &lt;iostream&gt;\r\n#include &lt;string&gt;\r\n#include &lt;experimental\/filesystem&gt;\r\nnamespace fs = std::experimental::filesystem;\r\n\r\nint main()\r\n{\r\n\t\/\/\/ current_path return the current directory as you may guess\r\n\tstd::cout &lt;&lt; \"Current path: \" &lt;&lt; fs::current_path() &lt;&lt; std::endl;\r\n\r\n\t\/\/\/ Create \"sandbox\/a\/b\" folders\r\n\tstd::string dir = \"sandbox\/a\/b\";\r\n\tfs::create_directories(dir);\r\n\r\n\tstd::ofstream(\"sandbox\/file1.txt\");\r\n\r\n\t\/\/ sym links not available for windows. exception is thrown\r\n#ifndef WIN32\r\n\tfs::path symPath = fs::current_path() \/= \"sandbox\";\r\n\tsymPath \/= \"syma\";\r\n\tfs::create_symlink(\"a\", \"symPath\");\r\n\tstd::cout &lt;&lt; \"fs::symlink(symPath): \" &lt;&lt; fs::is_symlink(symPath) &lt;&lt; std::endl;\r\n\tstd::cout &lt;&lt; \"fs::exists(symPath): \" &lt;&lt; fs::exists(symPath) &lt;&lt; std::endl;\r\n#endif\r\n\r\n\tstd::cout &lt;&lt; \"fs::is_directory(dir): \" &lt;&lt; fs::is_directory(dir) &lt;&lt; std::endl;\t\r\n\r\n\t\/\/ print directory content recursively\r\n\tfor (auto&amp; p : fs::recursive_directory_iterator(\"sandbox\"))\r\n\t\tstd::cout &lt;&lt; p &lt;&lt; std::endl;\r\n\t\r\n\t\/\/ remove root and all sub content\r\n\tfs::remove_all(\"sandbox\");\r\n\r\n\treturn 0;\r\n}<\/pre>\n<p>Here, you can see that basic folder operations can easily be performed by these APIs. So what can we do else with this library? Well briefly:<\/p>\n<ul>\n<li>Create\/inspect paths,<\/li>\n<li>Path modifications and comparisons,<\/li>\n<li>Path name conversion between native and generic formats,<\/li>\n<li>Iterating over directories\/files,<\/li>\n<li>Working with file attributes\/flags, status and permissions,<\/li>\n<li>File system modifications (create\/delete\/copy\/move files),<\/li>\n<li>For much more, check out\u00a0<a href=\"https:\/\/en.cppreference.com\/w\/cpp\/filesystem\"><strong><span style=\"color: #339966;\">https:\/\/en.cppreference.com\/w\/cpp\/filesystem.<\/span><\/strong><\/a><\/li>\n<\/ul>\n<h2><span style=\"text-decoration: underline;\"><span style=\"color: #0000ff;\"><strong>Path Objects:<\/strong><\/span><\/span><\/h2>\n<p>Let us start with path object which probably used most. Following code example summarize mosst common usage of path object.<\/p>\n<pre class=\"lang:c++ decode:true \">#include &lt;fstream&gt;\r\n#include &lt;iostream&gt;\r\n#include &lt;string&gt;\r\n#include &lt;time.h&gt;\r\n#include &lt;filesystem&gt;\r\nusing namespace std;\r\nnamespace fs = std::experimental::filesystem;\r\n\r\n\/\/ Print the path according to path format that I mentioned above where you can use each part\r\n\/\/ path is a container at the same time\r\nvoid iteratePathContent(const fs::path&amp; initialPath)\r\n{\r\n\tint i = 0;\r\n\r\n\tfor (const auto&amp; part : initialPath)\r\n\t\tcout &lt;&lt; \"Path part: \" &lt;&lt; i++ &lt;&lt; \" = \" &lt;&lt; part &lt;&lt; '\\n';\r\n}\r\n\r\n\r\n\/\/ Method to calculate the size of given file\r\n\/\/ Returns -1 for error\r\nuintmax_t calculateFileSize(const fs::path&amp; filePath)\r\n{\r\n\t\/\/ uintmax_t =&gt; maximum widht unsigned integer\r\n\tuintmax_t totalSize = static_cast&lt;uintmax_t&gt;(-1);\r\n\r\n\tif (fs::exists(filePath) &amp;&amp; fs::is_regular_file(filePath))\r\n\t{\r\n\t\tauto err = error_code{};\r\n\t\tauto filesize = fs::file_size(filePath, err);\r\n\r\n\t\tif (filesize != static_cast&lt;uintmax_t&gt;(-1))\r\n\t\t{\r\n\t\t\ttotalSize = filesize;\r\n\t\t}\r\n\t}\r\n\r\n\treturn totalSize;\r\n}\r\n\r\n\/\/ Method to calculate size the of given directory\r\n\/\/ Returns -1 for error\r\nuintmax_t calculateDirectorySize(const fs::path&amp; pathToCheck)\r\n{\r\n\tauto size = static_cast&lt;uintmax_t&gt;(-1);\r\n\tif (fs::exists(pathToCheck) &amp;&amp; fs::is_directory(pathToCheck))\r\n\t{\r\n\t\tfor (auto const &amp; entry : fs::recursive_directory_iterator(pathToCheck))\r\n\t\t{\r\n\t\t\tif (fs::is_regular_file(entry.status()) || fs::is_symlink(entry.status()))\r\n\t\t\t{\r\n\t\t\t\tauto err = error_code{};\r\n\t\t\t\tauto filesize = fs::file_size(entry, err);\r\n\t\t\t\tif (filesize != static_cast&lt;uintmax_t&gt;(-1) &amp;&amp; err != error_code())\r\n\t\t\t\t\tsize += filesize;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn size;\r\n}\r\n\r\n\/\/ Display given information about path\r\nvoid displayPathInfo(const fs::path&amp; pathToShow)\r\n{\r\n\tint i = 0;\r\n\tcout &lt;&lt; \"Displaying path info for: \" &lt;&lt; pathToShow &lt;&lt; '\\n';\r\n\tfor (const auto&amp; part : pathToShow)\r\n\t{\r\n\t\tcout &lt;&lt; \"path part: \" &lt;&lt; i++ &lt;&lt; \" = \" &lt;&lt; part &lt;&lt; '\\n';\r\n\t}\r\n\r\n\t\/\/ Catch any exception that may caused because of above function calls\r\n\ttry\r\n\t{\r\n\tcout &lt;&lt; \"exists() = \" &lt;&lt; fs::exists(pathToShow) &lt;&lt; '\\n'\r\n\t\t&lt;&lt; \"root_name() = \" &lt;&lt; pathToShow.root_name() &lt;&lt; '\\n'\r\n\t\t&lt;&lt; \"root_path() = \" &lt;&lt; pathToShow.root_path() &lt;&lt; '\\n'\r\n\t\t&lt;&lt; \"relative_path() = \" &lt;&lt; pathToShow.relative_path() &lt;&lt; '\\n'\r\n\t\t&lt;&lt; \"parent_path() = \" &lt;&lt; pathToShow.parent_path() &lt;&lt; '\\n'\r\n\t\t&lt;&lt; \"filename() = \" &lt;&lt; pathToShow.filename() &lt;&lt; '\\n'\r\n\t\t&lt;&lt; \"stem() = \" &lt;&lt; pathToShow.stem() &lt;&lt; '\\n'\r\n\t\t&lt;&lt; \"extension() = \" &lt;&lt; pathToShow.extension() &lt;&lt; '\\n';\r\n\r\n\t\tcout &lt;&lt; \"canonical() = \" &lt;&lt; fs::canonical(pathToShow) &lt;&lt; '\\n';\r\n\t}\r\n\tcatch (fs::filesystem_error err)\r\n\t{\r\n\t\tcout &lt;&lt; \"exception: \" &lt;&lt; err.what() &lt;&lt; '\\n';\r\n\t}\r\n}\r\n\r\n\/\/ Display file name, path, size and last modified time\r\nvoid displayFileInfo(const fs::directory_entry &amp; entry, string &amp;lead, fs::path &amp;filename)\r\n{\r\n\ttime_t cftime = chrono::system_clock::to_time_t(fs::last_write_time(entry));\r\n\t\r\n\t\/\/ You can also use non _s version\r\n\tchar timeStr[26];\r\n\tasctime_s(timeStr, sizeof timeStr, localtime(&amp;cftime));\r\n\r\n\tcout &lt;&lt; lead &lt;&lt; \" \" &lt;&lt; filename &lt;&lt; \", \"\r\n\t\t&lt;&lt; calculateFileSize(filename.c_str())\r\n\t\t&lt;&lt; \", time: \" &lt;&lt; timeStr;\r\n}\r\n\r\n\/\/ Display the content of path recursively using above methods\r\nvoid traverseAndDisplayFolderTree(const fs::path&amp; pathToShow, int level)\r\n{\r\n\tif (fs::exists(pathToShow) &amp;&amp; fs::is_directory(pathToShow))\r\n\t{\r\n\t\tauto lead = string(level * 3, ' ');\r\n\t\tfor (const auto&amp; entry : fs::directory_iterator(pathToShow))\r\n\t\t{\r\n\t\t\tauto filename = entry.path().filename();\r\n\t\t\tif (fs::is_directory(entry.status()))\r\n\t\t\t{\r\n\t\t\t\tcout &lt;&lt; lead &lt;&lt; \"[+] \" &lt;&lt; filename &lt;&lt; '\\n';\r\n\t\t\t\ttraverseAndDisplayFolderTree(entry, level + 1);\r\n\t\t\t\tcout &lt;&lt; '\\n';\r\n\t\t\t}\r\n\t\t\telse if (fs::is_regular_file(entry.status()))\r\n\t\t\t\tdisplayFileInfo(entry, lead, filename);\r\n\t\t\telse\r\n\t\t\t\tcout &lt;&lt; lead &lt;&lt; \" [?]\" &lt;&lt; filename &lt;&lt; '\\n';\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\/\/ A recursive funtion to initiate a traver from given path\r\nvoid traverseAndDisplayFolderTree(const fs::path&amp; initialPath)\r\n{\r\n\ttraverseAndDisplayFolderTree(initialPath, 0);\r\n}\r\n\r\nint main(int argc, char* argv[])\r\n{\r\n\t\/\/ you can se \/= and += operators. the former is used path concatenation and latter is used just for appending string\r\n\tfs::path examplePath(\"C:\\\\\");\r\n\texamplePath \/= \"Windows\";\r\n\texamplePath \/= \"System\";\r\n\r\n\tcout &lt;&lt; examplePath &lt;&lt; '\\n';\r\n\texamplePath += \"32\";\r\n\tcout &lt;&lt; examplePath &lt;&lt; '\\n';\r\n\r\n\t\/\/ current_path return the current directory as you may guess\r\n\tdisplayPathInfo(\"C:\\\\windows\\\\system.ini\");\r\n\r\n\t\/\/ iterate over path content\r\n\titeratePathContent(\"C:\\\\windows\\\\system.ini\");\r\n\r\n\t\/\/ traverse and display folders and content \r\n\tconst fs::path pathToShow{ argc &gt;= 2 ? argv[1] : fs::current_path() };\r\n\r\n\ttraverseAndDisplayFolderTree(pathToShow);\r\n\r\n\treturn 0;\r\n}<\/pre>\n<h2><strong><span style=\"color: #0000ff;\">Disk Space Info:<\/span><\/strong><\/h2>\n<p>Another useful object is std::filesystem::space_info which can be used to obtain total size of the filesystem, free space and available space on the filesystem as follow:<\/p>\n<pre class=\"lang:c++ decode:true\">#include &lt;iostream&gt;\r\n#include &lt;filesystem&gt;\r\nusing namespace std;\r\nnamespace fs = std::experimental::filesystem;\r\n\r\nint main()\r\n{\r\n\tfs::space_info devi = fs::space(\"\/windows\/system32\");\r\n\tfs::space_info tmpi = fs::space(\"C:\\\\\");\r\n\r\n\tcout &lt;&lt; \".                        Capacity       Free      Available\\n\"\r\n\t     &lt;&lt; \"\/windows\/system32:   \" &lt;&lt; devi.capacity &lt;&lt; \"   \"\r\n\t     &lt;&lt; devi.free &lt;&lt; \"   \" &lt;&lt; devi.available &lt;&lt; '\\n'\r\n\t     &lt;&lt; \"\/tmp:                \" &lt;&lt; tmpi.capacity &lt;&lt; \"   \"\r\n             &lt;&lt; tmpi.free &lt;&lt; \"   \" &lt;&lt; tmpi.available &lt;&lt; '\\n';\r\n}<\/pre>\n<h2><span style=\"color: #0000ff;\"><strong>Permissions:<\/strong><\/span><\/h2>\n<p>You can also access and play with permission attributes of files which is illustrated in following example. &#8220;<em>std::filesystem::perms&#8221;<\/em> which is <span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/en.cppreference.com\/w\/cpp\/named_req\/BitmaskType\"><strong>BitmaskType<\/strong><\/a><\/span>\u00a0is used with some predefined bit masks which can be found at (<span style=\"color: #339966;\"><strong><a style=\"color: #339966;\" href=\"https:\/\/en.cppreference.com\/w\/cpp\/filesystem\/perms\">https:\/\/en.cppreference.com\/w\/cpp\/filesystem\/perms<\/a><\/strong><\/span>). Follwing sample code shows how you can read and update these permissions.<\/p>\n<pre class=\"lang:c++ decode:true\">#include &lt;fstream&gt;\r\n#include &lt;bitset&gt;\r\n#include &lt;iostream&gt;\r\n#include &lt;filesystem&gt;\r\nnamespace fs = std::experimental::filesystem;\r\nusing namespace std;\r\n\r\nvoid displayPermissions(fs::perms p)\r\n{\r\n\tcout &lt;&lt; ((p &amp; fs::perms::owner_read) != fs::perms::none ? \"r\" : \"-\")\r\n\t\t&lt;&lt; ((p &amp; fs::perms::owner_write) != fs::perms::none ? \"w\" : \"-\")\r\n\t\t&lt;&lt; ((p &amp; fs::perms::owner_exec) != fs::perms::none ? \"x\" : \"-\")\r\n\t\t&lt;&lt; ((p &amp; fs::perms::group_read) != fs::perms::none ? \"r\" : \"-\")\r\n\t\t&lt;&lt; ((p &amp; fs::perms::group_write) != fs::perms::none ? \"w\" : \"-\")\r\n\t\t&lt;&lt; ((p &amp; fs::perms::group_exec) != fs::perms::none ? \"x\" : \"-\")\r\n\t\t&lt;&lt; ((p &amp; fs::perms::others_read) != fs::perms::none ? \"r\" : \"-\")\r\n\t\t&lt;&lt; ((p &amp; fs::perms::others_write) != fs::perms::none ? \"w\" : \"-\")\r\n\t\t&lt;&lt; ((p &amp; fs::perms::others_exec) != fs::perms::none ? \"x\" : \"-\")\r\n\t\t&lt;&lt; '\\n';\r\n}\r\n\r\nint main()\r\n{\r\n\t\/\/ create file\r\n\tofstream(\"test.txt\"); \r\n\r\n\tcout &lt;&lt; \"Created file with permissions: \";\r\n\tdisplayPermissions(fs::status(\"test.txt\").permissions());\r\n\r\n\t\/\/ change permissions\r\n\tfs::permissions(\"test.txt\",\r\n\t\tfs::perms::owner_all | fs::perms::group_all |\r\n\t\tfs::perms::add_perms);\r\n\r\n\tcout &lt;&lt; \"After adding o+rwx and g+rwx:  \";\r\n\tdisplayPermissions(fs::status(\"test.txt\").permissions());\r\n\r\n\t\/\/ Remove file\r\n\tfs::remove(\"test.txt\");\r\n}<\/pre>\n<h2><strong><span style=\"color: #0000ff;\">Last Modified Time:<\/span><\/strong><\/h2>\n<p>You can also use filesystem library with other libraries such as <em>std::chrono<\/em> to display last modified time of given file. An example usage is illustrated below:<\/p>\n<pre class=\"lang:c++ decode:true\">#include &lt;iostream&gt;\r\n#include &lt;chrono&gt;\r\n#include &lt;fstream&gt;\r\n#include &lt;filesystem&gt;\r\n\r\nnamespace fs = std::experimental::filesystem;\r\nusing namespace std::chrono_literals;\r\nusing namespace std;\r\n\r\nint main()\r\n{\r\n\t\/\/ You can define a path as follow\r\n\tfs::path path = fs::current_path() \/ \"example.txt\";\r\n\r\n\t\/\/ Create a file\r\n\tofstream exampleFile(path.c_str());\r\n\texampleFile.close();\r\n\r\n\t\/\/ Obtain last write time\r\n\tauto ftime = fs::last_write_time(path);\r\n\r\n\ttime_t cftime = chrono::system_clock::to_time_t(ftime);\r\n\tcout &lt;&lt; \"File write time is \" &lt;&lt; asctime(localtime(&amp;cftime)) &lt;&lt; '\\n';\r\n\r\n\t\/\/ move file write time 3 hour to the future\r\n\tfs::last_write_time(path, ftime + 3h);\r\n\r\n\t\/\/ read back from the filesystem\r\n\tftime = fs::last_write_time(path);\r\n\r\n\tcftime = chrono::system_clock::to_time_t(ftime);\r\n\r\n\t\/\/ TR time\r\n\tcout &lt;&lt; \"File write time is \" &lt;&lt; asctime(localtime(&amp;cftime)) &lt;&lt; endl;\r\n\r\n\t\/\/ Remove file\r\n\tfs::remove(path);\r\n\r\n\treturn 0;\r\n}<\/pre>\n<h2><strong><span style=\"color: #0000ff;\">Compiler\/Library support:<\/span><\/strong><\/h2>\n<p>By the way, the compiler support of this feature can be checked with other C++ features via <strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/en.cppreference.com\/w\/cpp\/compiler_support\">https:\/\/en.cppreference.com\/w\/cpp\/compiler_support<\/a>.<\/span><\/strong><br \/>\nDepending on the version of your compiler you might need to use <em>std::experimental::filesystem <\/em>namespace.<\/p>\n<p><strong>GCC<\/strong>: &#8220;<em>-lstdc++fs<\/em>&#8221; should be specified when you want filesystem. &#8220;<em><strong>&lt;experimental\/filesystem&gt;<\/strong>&#8220;<\/em> header should be included.<br \/>\nClang should be ready with Clang 5.0<br \/>\n<strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/libcxx.llvm.org\/cxx1z_status.html\">https:\/\/libcxx.llvm.org\/cxx1z_status.html<\/a><\/span><\/strong><br \/>\n<strong>Visual Studio<\/strong>: In case of Visual Studio, you need to include <strong><em>&lt;filesystem&gt;<\/em><\/strong> and<strong>\u00a0<\/strong><em><strong>std::experimental::filesystem<\/strong> <\/em>namespace should be used.<\/p>\n<h2><strong><span style=\"color: #0000ff;\">References<\/span><\/strong><\/h2>\n<ul>\n<li><a href=\"http:\/\/www.modernescpp.com\/index.php\/c-17-more-details-about-the-library\"><strong><span style=\"color: #339966;\">http:\/\/www.modernescpp.com\/index.php\/c-17-more-details-about-the-library<\/span><\/strong><\/a><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/en.cppreference.com\/w\/cpp\/experimental\/fs\">https:\/\/en.cppreference.com\/w\/cpp\/experimental\/fs<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2014\/n4100.pdf\">http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2014\/n4100.pdf<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2017\/n4659.pdf\">http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2017\/n4659.pdf<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/stackoverflow.com\/questions\/48347642\/differences-between-c14-stdexperimentalfilesystemv1-and-c17-stdfiles\">https:\/\/stackoverflow.com\/questions\/48347642\/differences-between-c14-stdexperimentalfilesystemv1-and-c17-stdfiles<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/www.packtpub.com\/application-development\/c17-stl-cookbook\">https:\/\/www.packtpub.com\/application-development\/c17-stl-cookbook<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/www.amazon.com\/Modern-Programming-Cookbook-multithreading-networking\/dp\/1786465183\">https:\/\/www.amazon.com\/Modern-Programming-Cookbook-multithreading-networking\/dp\/1786465183<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"http:\/\/www.cppstd17.com\/\">http:\/\/www.cppstd17.com\/<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/stackoverflow.com\/questions\/40899267\/how-similar-are-boost-filesystem-and-the-standard-c-filesystem-libraries\">https:\/\/stackoverflow.com\/questions\/40899267\/how-similar-are-boost-filesystem-and-the-standard-c-filesystem-libraries<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/www.boost.org\/doc\/libs\/1_68_0\/libs\/filesystem\/doc\/index.htm\">https:\/\/www.boost.org\/doc\/libs\/1_68_0\/libs\/filesystem\/doc\/index.htm<\/a><\/span><\/strong><\/li>\n<li><strong><span style=\"color: #339966;\"><a style=\"color: #339966;\" href=\"https:\/\/en.cppreference.com\/w\/cpp\/compiler_support\">https:\/\/en.cppreference.com\/w\/cpp\/compiler_support<\/a><\/span><\/strong><\/li>\n<\/ul>\n<p>[:]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[:tr]Herkese merhabalar, bir aradan sonra (umar\u0131m \u00e7ok da uzun olmayan), yeni bir haftal\u0131k C++ yaz\u0131m\u0131z ile birlikteyiz. Bu yaz\u0131mda, sizler ile birlikte uzun bir s\u00fcre beklenen (asl\u0131nda Java ve .Net gibi bir \u00e7ok platform ile sunulan ama C++ da standart bir \u015fekilde sunulmayan) STL kabiliyeti olan, dosya sistemi k\u00fct\u00fcphanesine bir g\u00f6z ataca\u011f\u0131z. Bu k\u00fct\u00fcphane, asl\u0131nda&#8230; <a class=\"more-link\" href=\"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/\">Continue reading <span class=\"meta-nav\">&#8594;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":174,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"dsgo_overlay_header":false,"dsgo_overlay_header_text_color":"","dsgo_overlay_skip_top_bar":false,"_designsetgo_exclude_llms":false,"footnotes":""},"categories":[10,41],"tags":[13,234,273,274,275,268,272,276,254,42,269,271,270,48,203],"class_list":["post-677","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c","category-modern-c","tag-c","tag-c-17","tag-dizin","tag-dizin-yolu","tag-dosya-ozellikleri","tag-dosya-sistemleri","tag-experimental","tag-filesystems-library","tag-haftalik-yazi","tag-modern-c","tag-path","tag-perms","tag-space-info","tag-stl","tag-weekly"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[:tr]Haftal\u0131k C++ 6 - Dosya Sistemi K\u00fct\u00fcphanesi[:en]Weekly C++ 6 - Filesystem Library[:] - Yaz\u0131l\u0131mperver&#039;in D\u00fcnyas\u0131<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[:tr]Haftal\u0131k C++ 6 - Dosya Sistemi K\u00fct\u00fcphanesi[:en]Weekly C++ 6 - Filesystem Library[:] - Yaz\u0131l\u0131mperver&#039;in D\u00fcnyas\u0131\" \/>\n<meta property=\"og:description\" content=\"[:tr]Herkese merhabalar, bir aradan sonra (umar\u0131m \u00e7ok da uzun olmayan), yeni bir haftal\u0131k C++ yaz\u0131m\u0131z ile birlikteyiz. Bu yaz\u0131mda, sizler ile birlikte uzun bir s\u00fcre beklenen (asl\u0131nda Java ve .Net gibi bir \u00e7ok platform ile sunulan ama C++ da standart bir \u015fekilde sunulmayan) STL kabiliyeti olan, dosya sistemi k\u00fct\u00fcphanesine bir g\u00f6z ataca\u011f\u0131z. Bu k\u00fct\u00fcphane, asl\u0131nda... Continue reading &#8594;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/\" \/>\n<meta property=\"og:site_name\" content=\"Yaz\u0131l\u0131mperver&#039;in D\u00fcnyas\u0131\" \/>\n<meta property=\"article:published_time\" content=\"2018-12-06T16:24:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-02-05T19:27:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/yazilimperver.net\/wp-content\/uploads\/2017\/12\/FeaturedImage-e1580417052514.png\" \/>\n\t<meta property=\"og:image:width\" content=\"32\" \/>\n\t<meta property=\"og:image:height\" content=\"32\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"yaz\u0131l\u0131mperver\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"yaz\u0131l\u0131mperver\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"26 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/12\\\/06\\\/english-weekly-c-6-filesystem-library\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/12\\\/06\\\/english-weekly-c-6-filesystem-library\\\/\"},\"author\":{\"name\":\"yaz\u0131l\u0131mperver\",\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/#\\\/schema\\\/person\\\/534a27860d56170658018ac4c6f1af16\"},\"headline\":\"[:tr]Haftal\u0131k C++ 6 &#8211; Dosya Sistemi K\u00fct\u00fcphanesi[:en]Weekly C++ 6 &#8211; Filesystem Library[:]\",\"datePublished\":\"2018-12-06T16:24:24+00:00\",\"dateModified\":\"2019-02-05T19:27:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/12\\\/06\\\/english-weekly-c-6-filesystem-library\\\/\"},\"wordCount\":2571,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/#\\\/schema\\\/person\\\/534a27860d56170658018ac4c6f1af16\"},\"image\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/12\\\/06\\\/english-weekly-c-6-filesystem-library\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/yazilimperver.net\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/FeaturedImage-e1580417052514.png\",\"keywords\":[\"c++\",\"c++ 17\",\"dizin\",\"dizin yolu\",\"dosya \u00f6zellikleri\",\"dosya sistemleri\",\"experimental\",\"filesystems library\",\"haftal\u0131k yaz\u0131\",\"Modern C++\",\"path\",\"perms\",\"space info\",\"STL\",\"Weekly\"],\"articleSection\":[\"C++\",\"Modern C++\"],\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/12\\\/06\\\/english-weekly-c-6-filesystem-library\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/12\\\/06\\\/english-weekly-c-6-filesystem-library\\\/\",\"url\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/12\\\/06\\\/english-weekly-c-6-filesystem-library\\\/\",\"name\":\"[:tr]Haftal\u0131k C++ 6 - Dosya Sistemi K\u00fct\u00fcphanesi[:en]Weekly C++ 6 - Filesystem Library[:] - Yaz\u0131l\u0131mperver&#039;in D\u00fcnyas\u0131\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/12\\\/06\\\/english-weekly-c-6-filesystem-library\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/12\\\/06\\\/english-weekly-c-6-filesystem-library\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/yazilimperver.net\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/FeaturedImage-e1580417052514.png\",\"datePublished\":\"2018-12-06T16:24:24+00:00\",\"dateModified\":\"2019-02-05T19:27:31+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/12\\\/06\\\/english-weekly-c-6-filesystem-library\\\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/12\\\/06\\\/english-weekly-c-6-filesystem-library\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/12\\\/06\\\/english-weekly-c-6-filesystem-library\\\/#primaryimage\",\"url\":\"https:\\\/\\\/yazilimperver.net\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/FeaturedImage-e1580417052514.png\",\"contentUrl\":\"https:\\\/\\\/yazilimperver.net\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/FeaturedImage-e1580417052514.png\",\"width\":32,\"height\":32},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/index.php\\\/2018\\\/12\\\/06\\\/english-weekly-c-6-filesystem-library\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ana sayfa\",\"item\":\"https:\\\/\\\/yazilimperver.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Haftal\u0131k C++ 6 &#8211; Dosya Sistemi K\u00fct\u00fcphanesi\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/#website\",\"url\":\"https:\\\/\\\/yazilimperver.net\\\/\",\"name\":\"Yaz\u0131l\u0131mperver'in D\u00fcnyas\u0131\",\"description\":\"Payla\u015fmak g\u00fczeldir.\",\"publisher\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/#\\\/schema\\\/person\\\/534a27860d56170658018ac4c6f1af16\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/yazilimperver.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/#\\\/schema\\\/person\\\/534a27860d56170658018ac4c6f1af16\",\"name\":\"yaz\u0131l\u0131mperver\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/cropped-OnlyIcon-1.png\",\"url\":\"https:\\\/\\\/yazilimperver.net\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/cropped-OnlyIcon-1.png\",\"contentUrl\":\"https:\\\/\\\/yazilimperver.net\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/cropped-OnlyIcon-1.png\",\"width\":512,\"height\":512,\"caption\":\"yaz\u0131l\u0131mperver\"},\"logo\":{\"@id\":\"https:\\\/\\\/yazilimperver.net\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/cropped-OnlyIcon-1.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[:tr]Haftal\u0131k C++ 6 - Dosya Sistemi K\u00fct\u00fcphanesi[:en]Weekly C++ 6 - Filesystem Library[:] - Yaz\u0131l\u0131mperver&#039;in D\u00fcnyas\u0131","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/","og_locale":"tr_TR","og_type":"article","og_title":"[:tr]Haftal\u0131k C++ 6 - Dosya Sistemi K\u00fct\u00fcphanesi[:en]Weekly C++ 6 - Filesystem Library[:] - Yaz\u0131l\u0131mperver&#039;in D\u00fcnyas\u0131","og_description":"[:tr]Herkese merhabalar, bir aradan sonra (umar\u0131m \u00e7ok da uzun olmayan), yeni bir haftal\u0131k C++ yaz\u0131m\u0131z ile birlikteyiz. Bu yaz\u0131mda, sizler ile birlikte uzun bir s\u00fcre beklenen (asl\u0131nda Java ve .Net gibi bir \u00e7ok platform ile sunulan ama C++ da standart bir \u015fekilde sunulmayan) STL kabiliyeti olan, dosya sistemi k\u00fct\u00fcphanesine bir g\u00f6z ataca\u011f\u0131z. Bu k\u00fct\u00fcphane, asl\u0131nda... Continue reading &#8594;","og_url":"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/","og_site_name":"Yaz\u0131l\u0131mperver&#039;in D\u00fcnyas\u0131","article_published_time":"2018-12-06T16:24:24+00:00","article_modified_time":"2019-02-05T19:27:31+00:00","og_image":[{"width":32,"height":32,"url":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2017\/12\/FeaturedImage-e1580417052514.png","type":"image\/png"}],"author":"yaz\u0131l\u0131mperver","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"yaz\u0131l\u0131mperver","Tahmini okuma s\u00fcresi":"26 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/#article","isPartOf":{"@id":"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/"},"author":{"name":"yaz\u0131l\u0131mperver","@id":"https:\/\/yazilimperver.net\/#\/schema\/person\/534a27860d56170658018ac4c6f1af16"},"headline":"[:tr]Haftal\u0131k C++ 6 &#8211; Dosya Sistemi K\u00fct\u00fcphanesi[:en]Weekly C++ 6 &#8211; Filesystem Library[:]","datePublished":"2018-12-06T16:24:24+00:00","dateModified":"2019-02-05T19:27:31+00:00","mainEntityOfPage":{"@id":"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/"},"wordCount":2571,"commentCount":0,"publisher":{"@id":"https:\/\/yazilimperver.net\/#\/schema\/person\/534a27860d56170658018ac4c6f1af16"},"image":{"@id":"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/#primaryimage"},"thumbnailUrl":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2017\/12\/FeaturedImage-e1580417052514.png","keywords":["c++","c++ 17","dizin","dizin yolu","dosya \u00f6zellikleri","dosya sistemleri","experimental","filesystems library","haftal\u0131k yaz\u0131","Modern C++","path","perms","space info","STL","Weekly"],"articleSection":["C++","Modern C++"],"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/","url":"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/","name":"[:tr]Haftal\u0131k C++ 6 - Dosya Sistemi K\u00fct\u00fcphanesi[:en]Weekly C++ 6 - Filesystem Library[:] - Yaz\u0131l\u0131mperver&#039;in D\u00fcnyas\u0131","isPartOf":{"@id":"https:\/\/yazilimperver.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/#primaryimage"},"image":{"@id":"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/#primaryimage"},"thumbnailUrl":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2017\/12\/FeaturedImage-e1580417052514.png","datePublished":"2018-12-06T16:24:24+00:00","dateModified":"2019-02-05T19:27:31+00:00","breadcrumb":{"@id":"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/"]}]},{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/#primaryimage","url":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2017\/12\/FeaturedImage-e1580417052514.png","contentUrl":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2017\/12\/FeaturedImage-e1580417052514.png","width":32,"height":32},{"@type":"BreadcrumbList","@id":"https:\/\/yazilimperver.net\/index.php\/2018\/12\/06\/english-weekly-c-6-filesystem-library\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Ana sayfa","item":"https:\/\/yazilimperver.net\/"},{"@type":"ListItem","position":2,"name":"Haftal\u0131k C++ 6 &#8211; Dosya Sistemi K\u00fct\u00fcphanesi"}]},{"@type":"WebSite","@id":"https:\/\/yazilimperver.net\/#website","url":"https:\/\/yazilimperver.net\/","name":"Yaz\u0131l\u0131mperver'in D\u00fcnyas\u0131","description":"Payla\u015fmak g\u00fczeldir.","publisher":{"@id":"https:\/\/yazilimperver.net\/#\/schema\/person\/534a27860d56170658018ac4c6f1af16"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/yazilimperver.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/yazilimperver.net\/#\/schema\/person\/534a27860d56170658018ac4c6f1af16","name":"yaz\u0131l\u0131mperver","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2018\/04\/cropped-OnlyIcon-1.png","url":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2018\/04\/cropped-OnlyIcon-1.png","contentUrl":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2018\/04\/cropped-OnlyIcon-1.png","width":512,"height":512,"caption":"yaz\u0131l\u0131mperver"},"logo":{"@id":"https:\/\/yazilimperver.net\/wp-content\/uploads\/2018\/04\/cropped-OnlyIcon-1.png"}}]}},"_links":{"self":[{"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/posts\/677","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/comments?post=677"}],"version-history":[{"count":0,"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/posts\/677\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/media\/174"}],"wp:attachment":[{"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/media?parent=677"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/categories?post=677"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yazilimperver.net\/index.php\/wp-json\/wp\/v2\/tags?post=677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}