{"id":5237,"date":"2017-04-10T19:16:36","date_gmt":"2017-04-10T19:16:36","guid":{"rendered":"https:\/\/www.modernescpp.com\/index.php\/c-17-more-details-about-the-library\/"},"modified":"2017-04-10T19:16:36","modified_gmt":"2017-04-10T19:16:36","slug":"c-17-more-details-about-the-library","status":"publish","type":"post","link":"https:\/\/www.modernescpp.com\/index.php\/c-17-more-details-about-the-library\/","title":{"rendered":"C++17- std::byte and std::filesystem"},"content":{"rendered":"<p>My post, <a href=\"https:\/\/www.modernescpp.com\/index.php\/c-17-what-s-new-in-the-library\">C++17 &#8211; What&#8217;s New in the Library<\/a>, was fine for the first overview. Today, I will look deeper into the new library.&nbsp;<\/p>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n<p>Let&#8217;s start with something new that I didn&#8217;t mention in my previous posts:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-4724\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2016\/04\/timeline.png\" alt=\"timeline\" width=\"700\" height=\"338\" style=\"margin: 15px;\" \/><\/p>\n<h2>std::byte<\/h2>\n<p><span style=\"font-family: courier new,courier;\">std::byte<\/span> is a distinct type implementing the concept of byte as specified in the C++ language definition. Now we know what a byte is. Therefore, a byte is not an integer or a character and, therefore, not open to programmer errors. Its job is to access object storage. Consequently, its interface consists only of methods for bitwise logical operations.<\/p>\n<p>&nbsp;<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #0000ff;\">namespace<\/span> std { \r\n\r\n  <span style=\"color: #0000ff;\">template<\/span> &lt;<span style=\"color: #0000ff;\">class<\/span> <span style=\"color: #2b91af;\">IntType<\/span>&gt; \r\n    constexpr byte <span style=\"color: #0000ff;\">operator<\/span>&lt;&lt;(byte b, IntType shift); \r\n  <span style=\"color: #0000ff;\">template<\/span> &lt;<span style=\"color: #0000ff;\">class<\/span> <span style=\"color: #2b91af;\">IntType<\/span>&gt; \r\n    constexpr byte <span style=\"color: #0000ff;\">operator<\/span>&gt;&gt;(byte b, IntType shift); \r\n  constexpr byte <span style=\"color: #0000ff;\">operator<\/span>|(byte l, byte r); \r\n  constexpr byte <span style=\"color: #0000ff;\">operator<\/span>&amp;(byte l, byte r); \r\n  constexpr byte <span style=\"color: #0000ff;\">operator<\/span>~(byte b); \r\n  constexpr byte <span style=\"color: #0000ff;\">operator<\/span>^(byte l, byte r); \r\n\r\n} \r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>You can use the function<span style=\"font-family: courier new,courier;\"> std::to_integer(std::byte b)<\/span> to convert a <span style=\"font-family: courier new,courier;\">std::byte<\/span> to an integer type and the call <span style=\"font-family: courier new,courier;\">std::byte{integer}<\/span> to do it the other way around. <span style=\"font-family: courier new,courier;\">integer<\/span> has to be a non-negative value smaller than <span style=\"font-family: courier new,courier;\">std::numeric_limits&lt;unsigned_char&gt;::max().<\/span><\/p>\n<p>Now to something you already know.<\/p>\n<\/p>\n<h2>The filesystem library<\/h2>\n<p>In the post, <a href=\"https:\/\/www.modernescpp.com\/index.php\/c-17-what-s-new-in-the-library\">C++17 &#8211; What&#8217;s New in the Library<\/a>, I gave a first impression of the filesystem library. The library uses three concepts file, file name, and path. Files can be directories, hard links, symbolic links, or regular files. Paths can be absolute, canonical, or relative. A canonical path includes no symlinks, &#8220;.&#8221; or &#8220;..&#8221; elements.<\/p>\n<p>You can create and remove directories, iterate over them, or check the properties of files.<\/p>\n<p>&nbsp;<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<table>\n<tbody>\n<tr>\n<td>\n<pre style=\"margin: 0; line-height: 125%;\"> 1\r\n 2\r\n 3\r\n 4\r\n 5\r\n 6\r\n 7\r\n 8\r\n 9\r\n10\r\n11\r\n12\r\n13\r\n14\r\n15\r\n16\r\n17\r\n18\r\n19\r\n20\r\n21\r\n22\r\n23\r\n24\r\n25\r\n26\r\n27\r\n28\r\n29\r\n30<\/pre>\n<\/td>\n<td>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008000;\">\/\/ filesystem.cpp<\/span>\r\n\r\n<span style=\"color: #0000ff;\">#include &lt;fstream&gt;<\/span>\r\n<span style=\"color: #0000ff;\">#include &lt;iostream&gt;<\/span>\r\n<span style=\"color: #0000ff;\">#include &lt;string&gt;<\/span>\r\n<span style=\"color: #0000ff;\">#include &lt;filesystem&gt;<\/span>\r\n<span style=\"color: #0000ff;\">namespace<\/span> fs = std::filesystem;\r\n \r\n<span style=\"color: #2b91af;\">int<\/span> main(){\r\n\r\n    std::cout &lt;&lt; <span style=\"color: #a31515;\">\"Current path: \"<\/span> &lt;&lt; fs::current_path() &lt;&lt; std::endl;\r\n\r\n    std::string dir= <span style=\"color: #a31515;\">\"sandbox\/a\/b\"<\/span>;\r\n    fs::create_directories(dir);\r\n\r\n    std::ofstream(<span style=\"color: #a31515;\">\"sandbox\/file1.txt\"<\/span>);\r\n    fs::path symPath= fs::current_path() \/=  <span style=\"color: #a31515;\">\"sandbox\"<\/span>;\r\n    symPath \/= <span style=\"color: #a31515;\">\"syma\"<\/span>;\r\n    fs::create_symlink(<span style=\"color: #a31515;\">\"a\"<\/span>, <span style=\"color: #a31515;\">\"symPath\"<\/span>);\r\n    \r\n    std::cout &lt;&lt; <span style=\"color: #a31515;\">\"fs::is_directory(dir): \"<\/span> &lt;&lt; fs::is_directory(dir) &lt;&lt; std::endl;\r\n    std::cout &lt;&lt; <span style=\"color: #a31515;\">\"fs::exists(symPath): \"<\/span>  &lt;&lt; fs::exists(symPath) &lt;&lt; std::endl;\r\n    std::cout &lt;&lt; <span style=\"color: #a31515;\">\"fs::symlink(symPath): \"<\/span> &lt;&lt; fs::is_symlink(symPath) &lt;&lt; std::endl;\r\n    \r\n\r\n    <span style=\"color: #0000ff;\">for<\/span>(<span style=\"color: #0000ff;\">auto<\/span>&amp; p: fs::recursive_directory_iterator(<span style=\"color: #a31515;\">\"sandbox\"<\/span>))\r\n        std::cout &lt;&lt; p &lt;&lt; std::endl;\r\n    <span style=\"color: #008000;\">\/\/ fs::remove_all(\"sandbox\");<\/span>\r\n    \r\n}\r\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<p>But there is more to it. So I will now focus on features that are not so obvious. At least for me. I will show you,<\/p>\n<ul>\n<li>how you can manipulate the file permissions,<\/li>\n<li>read the time values of a file,<\/li>\n<li>and even get the free and available space of the filesystem.<\/li>\n<\/ul>\n<p>I used for my examples the<span style=\"font-family: courier new,courier;\"> std:<\/span>:e<span style=\"font-family: courier new,courier;\">xperimental::filesystem<\/span> namespace. Therefore, I was able to run and check them on cppreference.com. Afterward, I adjusted the sources to the upcoming official names. That means I replaced the header <span style=\"font-family: courier new,courier;\">&lt;experimental\/filesystem&gt;<\/span> with <span style=\"font-family: courier new,courier;\">&lt;filesystem&gt;<\/span> and the namespace <span style=\"font-family: courier new,courier;\">std::experimental::filesystem<\/span> with <span style=\"font-family: courier new,courier;\">std::filesystem<\/span>.<\/p>\n<p>Let&#8217;s start with file permissions.<\/p>\n<h4>Permissions<\/h4>\n<p>The class std::filesystem::perms represent the permission. It is a <a href=\"http:\/\/en.cppreference.com\/w\/cpp\/concept\/BitmaskType\">BitmaskType<\/a> and can be manipulated by bitwise operations. The access permissions are based on <a href=\"https:\/\/en.wikipedia.org\/wiki\/POSIX\">POSIX.<\/a><a href=\"https:\/\/en.wikipedia.org\/wiki\/POSIX\"><\/a><\/p>\n<p>The program from <a href=\"http:\/\/en.cppreference.com\/w\/cpp\/filesystem\/perms\">cppreference.com<\/a> shows how you can read and manipulate the owner, group, and other (world) bits of a file.<\/p>\n<p>&nbsp;<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<table>\n<tbody>\n<tr>\n<td>\n<pre style=\"margin: 0; line-height: 125%;\"> 1\r\n 2\r\n 3\r\n 4\r\n 5\r\n 6\r\n 7\r\n 8\r\n 9\r\n10\r\n11\r\n12\r\n13\r\n14\r\n15\r\n16\r\n17\r\n18\r\n19\r\n20\r\n21\r\n22\r\n23\r\n24\r\n25\r\n26\r\n27\r\n28\r\n29\r\n30\r\n31\r\n32\r\n33\r\n34\r\n35\r\n36\r\n37\r\n38\r\n39\r\n40\r\n41\r\n42\r\n43<\/pre>\n<\/td>\n<td>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008000;\">\/\/ perms.cpp<\/span>\r\n\r\n<span style=\"color: #0000ff;\">#include &lt;fstream&gt;<\/span>\r\n<span style=\"color: #0000ff;\">#include &lt;bitset&gt;<\/span>\r\n<span style=\"color: #0000ff;\">#include &lt;iostream&gt;<\/span>\r\n<span style=\"color: #0000ff;\">#include &lt;filesystem&gt;<\/span>\r\n\r\n<span style=\"color: #0000ff;\">namespace<\/span> fs = std::filesystem;\r\n \r\n<span style=\"color: #2b91af;\">void<\/span> printPerms(fs::perms perm){\r\n  std::cout &lt;&lt; ((perm &amp; fs::perms::owner_read) != fs::perms::none ? <span style=\"color: #a31515;\">\"r\"<\/span> : <span style=\"color: #a31515;\">\"-\"<\/span>)\r\n            &lt;&lt; ((perm &amp; fs::perms::owner_write) != fs::perms::none ? <span style=\"color: #a31515;\">\"w\"<\/span> : <span style=\"color: #a31515;\">\"-\"<\/span>)\r\n            &lt;&lt; ((perm &amp; fs::perms::owner_exec) != fs::perms::none ? <span style=\"color: #a31515;\">\"x\"<\/span> : <span style=\"color: #a31515;\">\"-\"<\/span>)\r\n            &lt;&lt; ((perm &amp; fs::perms::group_read) != fs::perms::none ? <span style=\"color: #a31515;\">\"r\"<\/span> : <span style=\"color: #a31515;\">\"-\"<\/span>)\r\n            &lt;&lt; ((perm &amp; fs::perms::group_write) != fs::perms::none ? <span style=\"color: #a31515;\">\"w\"<\/span> : <span style=\"color: #a31515;\">\"-\"<\/span>)\r\n            &lt;&lt; ((perm &amp; fs::perms::group_exec) != fs::perms::none ? <span style=\"color: #a31515;\">\"x\"<\/span> : <span style=\"color: #a31515;\">\"-\"<\/span>)\r\n            &lt;&lt; ((perm &amp; fs::perms::others_read) != fs::perms::none ? <span style=\"color: #a31515;\">\"r\"<\/span> : <span style=\"color: #a31515;\">\"-\"<\/span>)\r\n            &lt;&lt; ((perm &amp; fs::perms::others_write) != fs::perms::none ? <span style=\"color: #a31515;\">\"w\"<\/span> : <span style=\"color: #a31515;\">\"-\"<\/span>)\r\n            &lt;&lt; ((perm &amp; fs::perms::others_exec) != fs::perms::none ? <span style=\"color: #a31515;\">\"x\"<\/span> : <span style=\"color: #a31515;\">\"-\"<\/span>)\r\n            &lt;&lt; std::endl;\r\n}\r\n\r\n\r\n<span style=\"color: #2b91af;\">int<\/span> main(){\r\n  \r\n    std::ofstream(<span style=\"color: #a31515;\">\"rainer.txt\"<\/span>);\r\n \r\n    std::cout &lt;&lt; <span style=\"color: #a31515;\">\"Initial file permissions for a file: \"<\/span>;\r\n    printPerms(fs::status(<span style=\"color: #a31515;\">\"rainer.txt\"<\/span>).permissions());\r\n \r\n    fs::permissions(<span style=\"color: #a31515;\">\"rainer.txt\"<\/span>, fs::perms::add_perms |\r\n                            fs::perms::owner_all | fs::perms::group_all);\r\n    std::cout &lt;&lt; <span style=\"color: #a31515;\">\"Adding all bits to owner and group:  \"<\/span>;\r\n    printPerms(fs::status(<span style=\"color: #a31515;\">\"rainer.txt\"<\/span>).permissions());\r\n    \r\n    fs::permissions(<span style=\"color: #a31515;\">\"rainer.txt\"<\/span>, fs::perms::remove_perms | \r\n                           fs::perms::owner_write | fs::perms::group_write | fs::perms::others_write);\r\n    std::cout &lt;&lt; <span style=\"color: #a31515;\">\"Removing the write bits for all:     \"<\/span>;\r\n    printPerms(fs::status(<span style=\"color: #a31515;\">\"rainer.txt\"<\/span>).permissions());\r\n \r\n    fs::remove(<span style=\"color: #a31515;\">\"rainer.txt\"<\/span>);\r\n    \r\n}\r\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h4>&nbsp;<\/h4>\n<p>I created in line 26 a new file. Thanks to the global function <a href=\"http:\/\/en.cppreference.com\/w\/cpp\/experimental\/fs\/status\">std::filesystem::status::permissions<\/a>, I get the file&#8217;s permissions and can display them in the function <span style=\"font-family: courier new,courier;\">prin<span id=\"transmark\"><\/span>tPerms<\/span> (lines 10-21). After I set the constant, <span style=\"font-family: courier new,courier;\">std::filesystem::add_perms<\/span> in line 31, I can add permissions to the owner and the file group. Doing it the other way around, I set the constant <span style=\"font-family: courier new,courier;\">std::filesystem::remove_perms<\/span> in line 36. Therefore, I can remove the written bits for all.<\/p>\n<p>Here is the output of the program.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-5234\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/04\/perms.png\" alt=\"perms\" style=\"margin: 15px;\" width=\"458\" height=\"78\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/04\/perms.png 458w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/04\/perms-300x51.png 300w\" sizes=\"auto, (max-width: 458px) 100vw, 458px\" \/><\/p>\n<p>A file has not only the notion of permission but also of time.<\/p>\n<h4>Time values<\/h4>\n<p>Thanks to the global function <span style=\"font-family: courier new,courier;\">std::filesystem::last_write_time<\/span>, I can read and write the last write time of a file. Here is the example based on the example of <a href=\"http:\/\/en.cppreference.com\/w\/cpp\/experimental\/fs\/last_write_time\">en.cppreference.com.<\/a><\/p>\n<p>&nbsp;<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<table>\n<tbody>\n<tr>\n<td>\n<pre style=\"margin: 0; line-height: 125%;\"> 1\r\n 2\r\n 3\r\n 4\r\n 5\r\n 6\r\n 7\r\n 8\r\n 9\r\n10\r\n11\r\n12\r\n13\r\n14\r\n15\r\n16\r\n17\r\n18\r\n19\r\n20\r\n21\r\n22\r\n23\r\n24\r\n25\r\n26\r\n27\r\n28\r\n29<\/pre>\n<\/td>\n<td>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008000;\">\/\/ fileTime.cpp<\/span>\r\n\r\n<span style=\"color: #0000ff;\">#include &lt;iostream&gt;<\/span>\r\n<span style=\"color: #0000ff;\">#include &lt;chrono&gt;<\/span>\r\n<span style=\"color: #0000ff;\">#include &lt;fstream&gt;<\/span>\r\n<span style=\"color: #0000ff;\">#include &lt;filesystem&gt;<\/span>\r\n\r\n<span style=\"color: #0000ff;\">namespace<\/span> fs = std::filesystem;\r\n<span style=\"color: #0000ff;\">using<\/span> <span style=\"color: #0000ff;\">namespace<\/span> std::chrono_literals;\r\n\r\n<span style=\"color: #2b91af;\">int<\/span> main(){\r\n    \r\n    fs::path path = fs::current_path() \/ <span style=\"color: #a31515;\">\"rainer.txt\"<\/span>;\r\n    std::ofstream(path.c_str()); \r\n    <span style=\"color: #0000ff;\">auto<\/span> ftime = fs::last_write_time(path);\r\n \r\n    std::<span style=\"color: #2b91af;\">time_t<\/span> cftime = std::chrono::system_clock::<span style=\"color: #2b91af;\">to_time_t<\/span>(ftime); \r\n    std::cout &lt;&lt; <span style=\"color: #a31515;\">\"Write time on server \"<\/span> &lt;&lt; std::asctime(std::localtime(&amp;cftime));\r\n    std::cout &lt;&lt; <span style=\"color: #a31515;\">\"Write time on server \"<\/span> &lt;&lt; std::asctime(std::gmtime(&amp;cftime)) &lt;&lt; std::endl;\r\n \r\n    fs::last_write_time(path, ftime + 2h);\r\n    ftime = fs::last_write_time(path); \r\n \r\n    cftime = std::chrono::system_clock::<span style=\"color: #2b91af;\">to_time_t<\/span>(ftime);\r\n    std::cout &lt;&lt; <span style=\"color: #a31515;\">\"Local time on client \"<\/span> &lt;&lt; std::asctime(std::localtime(&amp;cftime)) &lt;&lt; std::endl;\r\n    \r\n    fs::remove(path);\r\n    \r\n}\r\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<p>In line 15, I get the right time for the newly created file. I use <span style=\"font-family: courier new,courier;\">ftime <\/span>in line 17 to initialize<span style=\"font-family: courier new,courier;\"> std::chrono::system_clock. ftime <\/span>is of type<span style=\"font-family: courier new,courier;\"> std::filesystem::file_time_type<\/span>, which seems on the server alias for<span style=\"font-family: courier new,courier;\"> std::chrono::system_clock. <\/span>That is fine. Therefore, I can initialize<span style=\"font-family: courier new,courier;\"> std::localtime <\/span>in line 18 and present the calendar time in a textual representation. Nothing will change if I use std::gmtime instead of std::localtime (line 18). That puzzled me because the Coordinated Universal Time (UTC) differs 2 hours from the local time in German. But that&#8217;s okay because that will not hold for the server. UTS and local time are the same on the server.&nbsp;<\/p>\n<p>Here is the output of the program. In addition, you see the local time in Germany. I got it by adding 2 hours (line 21) to the last write time of the file.<\/p>\n<p>&nbsp;<img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-5235\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/04\/fileTime.png\" alt=\"fileTime\" style=\"margin: 15px;\" width=\"455\" height=\"103\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/04\/fileTime.png 455w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/04\/fileTime-300x68.png 300w\" sizes=\"auto, (max-width: 455px) 100vw, 455px\" \/><\/p>\n<p>Now to the feature that astonished me the most.<\/p>\n<h4>Space info<\/h4>\n<p>The global function <span style=\"font-family: courier new,courier;\">std::filesystem::space<\/span> returns a <span style=\"font-family: courier new,courier;\">std::filesystem::space_info<\/span> object with the three members <span style=\"font-family: courier new,courier;\">capacity, free<\/span>, and<span style=\"font-family: courier new,courier;\"> available.<br \/><\/span><\/p>\n<ul>\n<li><span style=\"font-family: courier new,courier;\"><strong>capacity: <\/strong><\/span>total size of the filesystem<\/li>\n<li><span style=\"font-family: courier new,courier;\"><strong>free: <\/strong><\/span>free<span style=\"font-family: courier new,courier;\"> <\/span>space on the filesystem<\/li>\n<li><span style=\"font-family: courier new,courier;\"><strong>available: <\/strong><\/span>free space to a non-privileged process (maybe equal or less than free)<\/li>\n<\/ul>\n<p>All sizes are in bytes. The output of the following program is from cppreference.com. All the paths I tried were on the same filesystem. Therefore, I always get the same answer.<\/p>\n<p>&nbsp;<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<table>\n<tbody>\n<tr>\n<td>\n<pre style=\"margin: 0; line-height: 125%;\"> 1\r\n 2\r\n 3\r\n 4\r\n 5\r\n 6\r\n 7\r\n 8\r\n 9\r\n10\r\n11\r\n12\r\n13\r\n14\r\n15\r\n16\r\n17\r\n18\r\n19<\/pre>\n<\/td>\n<td>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008000;\">\/\/ space.cpp<\/span>\r\n\r\n<span style=\"color: #0000ff;\">#include &lt;iostream&gt;<\/span>\r\n<span style=\"color: #0000ff;\">#include &lt;filesystem&gt;<\/span>\r\n\r\n<span style=\"color: #0000ff;\">namespace<\/span> fs = std::filesystem;\r\n\r\n<span style=\"color: #2b91af;\">int<\/span> main(){\r\n    \r\n    fs::space_info root = fs::space(<span style=\"color: #a31515;\">\"\/\"<\/span>);\r\n    fs::space_info usr = fs::space(<span style=\"color: #a31515;\">\"\/usr\"<\/span>);\r\n \r\n    std::cout &lt;&lt; <span style=\"color: #a31515;\">\".        Capacity       Free      Available\\n\"<\/span>\r\n              &lt;&lt; <span style=\"color: #a31515;\">\"\/    \"<\/span> &lt;&lt; root.capacity &lt;&lt; <span style=\"color: #a31515;\">\"   \"<\/span>\r\n              &lt;&lt; root.free &lt;&lt; <span style=\"color: #a31515;\">\"   \"<\/span> &lt;&lt; root.available &lt;&lt; <span style=\"color: #a31515;\">\"\\n\"<\/span>   \r\n              &lt;&lt; <span style=\"color: #a31515;\">\"usr  \"<\/span>  &lt;&lt; usr.capacity &lt;&lt; <span style=\"color: #a31515;\">\"   \"<\/span>\r\n              &lt;&lt; usr.free &lt;&lt;  <span style=\"color: #a31515;\">\"   \"<\/span> &lt;&lt; usr.available;\r\n              \r\n}\r\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;Here are the numbers.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-5236\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/04\/space.png\" alt=\"space\" style=\"margin: 15px;\" width=\"425\" height=\"76\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/04\/space.png 425w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/04\/space-300x54.png 300w\" sizes=\"auto, (max-width: 425px) 100vw, 425px\" \/><\/p>\n<h2>More Information<\/h2>\n<ul>\n<li>\n<p class=\"post-title entry-title\" itemprop=\"name\"><a href=\"http:\/\/www.bfilipek.com\/2017\/08\/cpp17-details-filesystem.html\">C++17 in details: Filesystem<\/a><\/p>\n<\/li>\n<\/ul>\n<h2>What&#8217;s next?<\/h2>\n<p>Our journey through the details of C++17 goes on. The <a href=\"https:\/\/www.modernescpp.com\/index.php\/c-17-avoid-copying-with-std-string-view\">next post<\/a> will continue with<span style=\"font-family: courier new,courier;\"> std::string_view.<\/span><\/p>\n<p>&nbsp;<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>My post, C++17 &#8211; What&#8217;s New in the Library, was fine for the first overview. Today, I will look deeper into the new library.&nbsp;<\/p>\n","protected":false},"author":21,"featured_media":4724,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[370],"tags":[],"class_list":["post-5237","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-17"],"_links":{"self":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/5237","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/comments?post=5237"}],"version-history":[{"count":0,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/5237\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/media\/4724"}],"wp:attachment":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/media?parent=5237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/categories?post=5237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/tags?post=5237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}