{"id":976,"date":"2017-06-18T23:17:11","date_gmt":"2017-06-18T14:17:11","guid":{"rendered":"http:\/\/dev.activebasic.com\/egtra\/?p=976"},"modified":"2017-06-18T23:17:11","modified_gmt":"2017-06-18T14:17:11","slug":"vc-filesystem%e3%81%ae%e3%83%91%e3%83%bc%e3%83%9f%e3%83%83%e3%82%b7%e3%83%a7%e3%83%b3%e5%8f%96%e5%be%97%e3%81%ae%e5%ae%9f%e8%a3%85","status":"publish","type":"post","link":"https:\/\/dev.activebasic.com\/egtra\/2017\/06\/18\/976\/","title":{"rendered":"VC++ filesystem\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u53d6\u5f97\u306e\u5b9f\u88c5"},"content":{"rendered":"<p>C++ filesystem\u306b\u306f\u3001\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u53d6\u5f97\u30fb\u8a2d\u5b9a\u3059\u308b\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u3093\u306a\u308f\u3051\u3067\u3001\u305f\u3068\u3048\u3070\u3053\u308c\u3092\u305d\u306e\u8fba\u306eUnix\u7cfb\u30b7\u30b9\u30c6\u30e0\u3067g++\u3092\u4f7f\u3063\u3066\u30b3\u30f3\u30d1\u30a4\u30eb\u30fb\u5b9f\u884c\u3059\u308c\u3070\u3001755\u3068\u3044\u3046\u51fa\u529b\u304c\u5f97\u3089\u308c\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<pre lang=\"cpp\">\r\n#include <iostream>\r\n#include <experimental\/filesystem>\r\n\r\nint main()\r\n{\r\n  using namespace std::experimental::filesystem;\r\n\r\n  auto perm = status(\"\/bin\/sh\").permissions();\r\n  std::cout << std::oct << static_cast<int>(perm) << std::endl;\r\n}\r\n<\/pre>\n<p>\u3055\u3066\u3001\u3053\u308cWindows\u3060\u3068\u3069\u3046\u306a\u308b\u306e\u3060\u308d\u3046\uff1f\u3068\u601d\u3046\u308f\u3051\u3067\u3059\u3002\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<hr>\n<p>\u3053\u308c\u3092Visual C++ 2015\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u30fb\u5b9f\u884c\u3059\u308b\u3068\u3001777\u3068\u3044\u3046\u51fa\u529b\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<pre lang=\"cpp\">\r\n#include <iostream>\r\n#include <experimental\/filesystem>\r\n\r\nint main()\r\n{\r\n  using namespace std::experimental::filesystem;\r\n\r\n  auto perm = status(R\"(C:\\Windows\\win.ini)\").permissions();\r\n  std::cout << std::oct << static_cast<int>(perm) << std::endl;\r\n}\r\n<\/pre>\n<p>\u7121\u6761\u4ef6\u306b777\u3068\u306a\u308b\u306e\u3067\u3057\u3087\u3046\u304b\uff1f\u3068\u3044\u3046\u308f\u3051\u3067\u3001Visual C++\u306e\u5b9f\u88c5\u3092\u773a\u3081\u3066\u307f\u307e\u3059\u3002\u63a2\u3057\u305f\u3068\u3053\u308d\u3001VC++ 2015\u3084VC++ 2017\u3067\u306fsrc\/src\/filesys.h\u306b\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<pre lang=\"cpp\">\r\n  \/\/ FILE STATUS FUNCTIONS\r\n_FS_DLL _File_type __CLRCALL_PURE_OR_CDECL _Stat(const TCHAR *_Fname, _Perms *_Pmode)\r\n{  \/\/ get file status\r\nWIN32_FILE_ATTRIBUTE_DATA _Data;\r\n\r\nif (TFUN(GetFileAttributesEx)(_Fname, GetFileExInfoStandard, &_Data))\r\n  {  \/\/ get file type and return permissions\r\n  if (_Pmode != 0)\r\n    *_Pmode = _Data.dwFileAttributes & FILE_ATTRIBUTE_READONLY\r\n      ? READONLY_PERMS : perms::all;\r\n  return (_Map_mode(_Data.dwFileAttributes));\r\n  }\r\nelse\r\n<\/pre>\n<p>\u8aad\u307f\u53d6\u308a\u5c02\u7528\u5c5e\u6027\u304c\u4ed8\u3044\u3066\u3044\u305f\u3089555\u3001\u305d\u3046\u3067\u306a\u3051\u308c\u3070777\u3068\u3044\u3046\u5b9f\u88c5\u3067\u3057\u305f\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001Boost.Fileystem\u306e\u307b\u3046\u306f\u3069\u3046\u306a\u3063\u3066\u3044\u308b\u304b\u3068\u3044\u3046\u3068\u3001\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u30fb\u30d0\u30c3\u30c1\u30d5\u30a1\u30a4\u30eb\u306e\u5834\u5408\u306e\u307f\u5b9f\u884c\u30d3\u30c3\u30c8\u3092\u7acb\u3066\u308b\u5b9f\u88c5\u3068\u306a\u3063\u3066\u3044\u308b\u3088\u3046\u3067\u3059: <a href=\"https:\/\/github.com\/boostorg\/filesystem\/blob\/boost-1.64.0\/src\/operations.cpp\">filesystem\/operations.cpp at boost-1.64.0 \u00b7 boostorg\/filesystem<\/a>\uff081805\u884c\u76ee\u304b\u3089\u306e\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u306e\u5224\u5b9a\u3082\u3001VC++\u3068\u7570\u306a\u308a\u307e\u3059\uff09\u3002<\/p>\n<p>Windows\u306e\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306e\u30a2\u30af\u30bb\u30b9\u5236\u5fa1\u306fUnix\u7cfb\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3068\u306f\u7570\u306a\u308b\u4ed5\u7d44\u307f\u3067\u3042\u308b\u4ee5\u4e0a\u3001\u306a\u3093\u3089\u304b\u9069\u5f53\u306a\u6570\u5024\u3092\u3067\u3063\u3061\u4e0a\u3052\u308b\u3057\u304b\u3042\u308a\u307e\u305b\u3093\u3002\u305d\u3093\u306a\u308f\u3051\u306a\u306e\u3067\u3001\u3069\u3046\u306a\u3063\u3066\u3044\u308b\u306e\u304b\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VC++\u306efilesystem\u3067\u30d5\u30a1\u30a4\u30eb\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u53d6\u5f97\u3059\u308b\u3068\u4f55\u304c\u5f97\u3089\u308c\u308b\u306e\u304b\u8abf\u3079\u307e\u3057\u305f\u3002777\u304b555\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5,12],"tags":[45,324,323],"class_list":["post-976","post","type-post","status-publish","format-standard","hentry","category-cpp","category-vc","tag-boost","tag-boost-filesystem","tag-cplusplus17"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>VC++ filesystem\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u53d6\u5f97\u306e\u5b9f\u88c5 - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d<\/title>\n<meta name=\"description\" content=\"VC++\u306efilesystem\u3067\u30d5\u30a1\u30a4\u30eb\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u53d6\u5f97\u3059\u308b\u3068\u4f55\u304c\u5f97\u3089\u308c\u308b\u306e\u304b\u8abf\u3079\u307e\u3057\u305f\u3002777\u304b555\u306b\u306a\u308a\u307e\u3057\u305f\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dev.activebasic.com\/egtra\/2017\/06\/18\/976\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VC++ filesystem\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u53d6\u5f97\u306e\u5b9f\u88c5 - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d\" \/>\n<meta property=\"og:description\" content=\"VC++\u306efilesystem\u3067\u30d5\u30a1\u30a4\u30eb\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u53d6\u5f97\u3059\u308b\u3068\u4f55\u304c\u5f97\u3089\u308c\u308b\u306e\u304b\u8abf\u3079\u307e\u3057\u305f\u3002777\u304b555\u306b\u306a\u308a\u307e\u3057\u305f\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dev.activebasic.com\/egtra\/2017\/06\/18\/976\/\" \/>\n<meta property=\"og:site_name\" content=\"\u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ysk.noh\" \/>\n<meta property=\"article:published_time\" content=\"2017-06-18T14:17:11+00:00\" \/>\n<meta name=\"author\" content=\"egtra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@egtra\" \/>\n<meta name=\"twitter:site\" content=\"@egtra\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"egtra\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/2017\/06\/18\/976\/\",\"url\":\"https:\/\/dev.activebasic.com\/egtra\/2017\/06\/18\/976\/\",\"name\":\"VC++ filesystem\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u53d6\u5f97\u306e\u5b9f\u88c5 - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d\",\"isPartOf\":{\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/#website\"},\"datePublished\":\"2017-06-18T14:17:11+00:00\",\"dateModified\":\"2017-06-18T14:17:11+00:00\",\"author\":{\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/#\/schema\/person\/8de756b2ff20b964f64594dfe8f18164\"},\"description\":\"VC++\u306efilesystem\u3067\u30d5\u30a1\u30a4\u30eb\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u53d6\u5f97\u3059\u308b\u3068\u4f55\u304c\u5f97\u3089\u308c\u308b\u306e\u304b\u8abf\u3079\u307e\u3057\u305f\u3002777\u304b555\u306b\u306a\u308a\u307e\u3057\u305f\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/2017\/06\/18\/976\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dev.activebasic.com\/egtra\/2017\/06\/18\/976\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/2017\/06\/18\/976\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\/\/dev.activebasic.com\/egtra\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VC++ filesystem\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u53d6\u5f97\u306e\u5b9f\u88c5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/#website\",\"url\":\"https:\/\/dev.activebasic.com\/egtra\/\",\"name\":\"\u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d\",\"description\":\"\u982d\u306e\u4e2d\u306e\u304b\u3051\u3089\u3002ActiveBasic\u3092\u4e2d\u5fc3\u306b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u8a71\u3092\u307c\u3061\u307c\u3061\u3068\u3002\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dev.activebasic.com\/egtra\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/#\/schema\/person\/8de756b2ff20b964f64594dfe8f18164\",\"name\":\"egtra\",\"sameAs\":[\"https:\/\/x.com\/egtra\"],\"url\":\"https:\/\/dev.activebasic.com\/egtra\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"VC++ filesystem\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u53d6\u5f97\u306e\u5b9f\u88c5 - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d","description":"VC++\u306efilesystem\u3067\u30d5\u30a1\u30a4\u30eb\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u53d6\u5f97\u3059\u308b\u3068\u4f55\u304c\u5f97\u3089\u308c\u308b\u306e\u304b\u8abf\u3079\u307e\u3057\u305f\u3002777\u304b555\u306b\u306a\u308a\u307e\u3057\u305f\u3002","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:\/\/dev.activebasic.com\/egtra\/2017\/06\/18\/976\/","og_locale":"ja_JP","og_type":"article","og_title":"VC++ filesystem\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u53d6\u5f97\u306e\u5b9f\u88c5 - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d","og_description":"VC++\u306efilesystem\u3067\u30d5\u30a1\u30a4\u30eb\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u53d6\u5f97\u3059\u308b\u3068\u4f55\u304c\u5f97\u3089\u308c\u308b\u306e\u304b\u8abf\u3079\u307e\u3057\u305f\u3002777\u304b555\u306b\u306a\u308a\u307e\u3057\u305f\u3002","og_url":"https:\/\/dev.activebasic.com\/egtra\/2017\/06\/18\/976\/","og_site_name":"\u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d","article_publisher":"https:\/\/www.facebook.com\/ysk.noh","article_published_time":"2017-06-18T14:17:11+00:00","author":"egtra","twitter_card":"summary_large_image","twitter_creator":"@egtra","twitter_site":"@egtra","twitter_misc":{"\u57f7\u7b46\u8005":"egtra"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/dev.activebasic.com\/egtra\/2017\/06\/18\/976\/","url":"https:\/\/dev.activebasic.com\/egtra\/2017\/06\/18\/976\/","name":"VC++ filesystem\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u53d6\u5f97\u306e\u5b9f\u88c5 - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d","isPartOf":{"@id":"https:\/\/dev.activebasic.com\/egtra\/#website"},"datePublished":"2017-06-18T14:17:11+00:00","dateModified":"2017-06-18T14:17:11+00:00","author":{"@id":"https:\/\/dev.activebasic.com\/egtra\/#\/schema\/person\/8de756b2ff20b964f64594dfe8f18164"},"description":"VC++\u306efilesystem\u3067\u30d5\u30a1\u30a4\u30eb\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u53d6\u5f97\u3059\u308b\u3068\u4f55\u304c\u5f97\u3089\u308c\u308b\u306e\u304b\u8abf\u3079\u307e\u3057\u305f\u3002777\u304b555\u306b\u306a\u308a\u307e\u3057\u305f\u3002","breadcrumb":{"@id":"https:\/\/dev.activebasic.com\/egtra\/2017\/06\/18\/976\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dev.activebasic.com\/egtra\/2017\/06\/18\/976\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/dev.activebasic.com\/egtra\/2017\/06\/18\/976\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/dev.activebasic.com\/egtra\/"},{"@type":"ListItem","position":2,"name":"VC++ filesystem\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u53d6\u5f97\u306e\u5b9f\u88c5"}]},{"@type":"WebSite","@id":"https:\/\/dev.activebasic.com\/egtra\/#website","url":"https:\/\/dev.activebasic.com\/egtra\/","name":"\u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d","description":"\u982d\u306e\u4e2d\u306e\u304b\u3051\u3089\u3002ActiveBasic\u3092\u4e2d\u5fc3\u306b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u8a71\u3092\u307c\u3061\u307c\u3061\u3068\u3002","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dev.activebasic.com\/egtra\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/dev.activebasic.com\/egtra\/#\/schema\/person\/8de756b2ff20b964f64594dfe8f18164","name":"egtra","sameAs":["https:\/\/x.com\/egtra"],"url":"https:\/\/dev.activebasic.com\/egtra\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/posts\/976"}],"collection":[{"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/comments?post=976"}],"version-history":[{"count":0,"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/posts\/976\/revisions"}],"wp:attachment":[{"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/media?parent=976"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/categories?post=976"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/tags?post=976"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}