{"id":16709,"date":"2024-01-30T08:48:32","date_gmt":"2024-01-30T05:18:32","guid":{"rendered":"https:\/\/rasanegar.com\/blog\/%d9%be%d8%a7%db%8c%d8%aa%d9%88%d9%86-%d8%a8%d8%b1%d8%b1%d8%b3%db%8c-%da%a9%d9%86%db%8c%d8%af-%da%a9%d9%87-%d8%a2%db%8c%d8%a7-%db%8c%da%a9-%d9%81%d8%a7%db%8c%d9%84-%db%8c%d8%a7-%d8%af%d8%a7%db%8c\/"},"modified":"2024-01-30T08:48:32","modified_gmt":"2024-01-30T05:18:32","slug":"%d9%be%d8%a7%db%8c%d8%aa%d9%88%d9%86-%d8%a8%d8%b1%d8%b1%d8%b3%db%8c-%da%a9%d9%86%db%8c%d8%af-%da%a9%d9%87-%d8%a2%db%8c%d8%a7-%db%8c%da%a9-%d9%81%d8%a7%db%8c%d9%84-%db%8c%d8%a7-%d8%af%d8%a7%db%8c","status":"publish","type":"post","link":"https:\/\/rasanegaar.com\/blog\/%d9%be%d8%a7%db%8c%d8%aa%d9%88%d9%86-%d8%a8%d8%b1%d8%b1%d8%b3%db%8c-%da%a9%d9%86%db%8c%d8%af-%da%a9%d9%87-%d8%a2%db%8c%d8%a7-%db%8c%da%a9-%d9%81%d8%a7%db%8c%d9%84-%db%8c%d8%a7-%d8%af%d8%a7%db%8c\/","title":{"rendered":"\u067e\u0627\u06cc\u062a\u0648\u0646: \u0628\u0631\u0631\u0633\u06cc \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0622\u06cc\u0627 \u06cc\u06a9 \u0641\u0627\u06cc\u0644 \u06cc\u0627 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f \u06cc\u0627 \u062e\u06cc\u0631"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\"><p class=\"ez-toc-title\" style=\"cursor:inherit\">\u0633\u0631\u0641\u0635\u0644\u0647\u0627\u06cc \u0645\u0637\u0644\u0628<\/p>\n<\/div><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/rasanegaar.com\/blog\/%d9%be%d8%a7%db%8c%d8%aa%d9%88%d9%86-%d8%a8%d8%b1%d8%b1%d8%b3%db%8c-%da%a9%d9%86%db%8c%d8%af-%da%a9%d9%87-%d8%a2%db%8c%d8%a7-%db%8c%da%a9-%d9%81%d8%a7%db%8c%d9%84-%db%8c%d8%a7-%d8%af%d8%a7%db%8c\/#%d8%a8%d8%b1%d8%b1%d8%b3%db%8c_%d9%88%d8%ac%d9%88%d8%af_%d9%81%d8%a7%db%8c%d9%84\" >\u0628\u0631\u0631\u0633\u06cc \u0648\u062c\u0648\u062f \u0641\u0627\u06cc\u0644<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/rasanegaar.com\/blog\/%d9%be%d8%a7%db%8c%d8%aa%d9%88%d9%86-%d8%a8%d8%b1%d8%b1%d8%b3%db%8c-%da%a9%d9%86%db%8c%d8%af-%da%a9%d9%87-%d8%a2%db%8c%d8%a7-%db%8c%da%a9-%d9%81%d8%a7%db%8c%d9%84-%db%8c%d8%a7-%d8%af%d8%a7%db%8c\/#%d8%a8%d8%b1%d8%b1%d8%b3%db%8c_%d9%88%d8%ac%d9%88%d8%af_%d8%af%d8%a7%db%8c%d8%b1%da%a9%d8%aa%d9%88%d8%b1%db%8c\" >\u0628\u0631\u0631\u0633\u06cc \u0648\u062c\u0648\u062f \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/rasanegaar.com\/blog\/%d9%be%d8%a7%db%8c%d8%aa%d9%88%d9%86-%d8%a8%d8%b1%d8%b1%d8%b3%db%8c-%da%a9%d9%86%db%8c%d8%af-%da%a9%d9%87-%d8%a2%db%8c%d8%a7-%db%8c%da%a9-%d9%81%d8%a7%db%8c%d9%84-%db%8c%d8%a7-%d8%af%d8%a7%db%8c\/#%d8%a8%d8%b1%d8%b1%d8%b3%db%8c_%d8%a7%db%8c%d9%86%da%a9%d9%87_%d8%a2%db%8c%d8%a7_%d9%88%d8%ac%d9%88%d8%af_%d8%af%d8%a7%d8%b1%d8%af_%db%8c%d8%a7_%d8%ae%db%8c%d8%b1\" >\u0628\u0631\u0631\u0633\u06cc \u0627\u06cc\u0646\u06a9\u0647 \u0622\u06cc\u0627 \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f \u06cc\u0627 \u062e\u06cc\u0631<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/rasanegaar.com\/blog\/%d9%be%d8%a7%db%8c%d8%aa%d9%88%d9%86-%d8%a8%d8%b1%d8%b1%d8%b3%db%8c-%da%a9%d9%86%db%8c%d8%af-%da%a9%d9%87-%d8%a2%db%8c%d8%a7-%db%8c%da%a9-%d9%81%d8%a7%db%8c%d9%84-%db%8c%d8%a7-%d8%af%d8%a7%db%8c\/#%d9%be%db%8c%d8%b4%d8%b1%d9%81%d8%aa%d9%87\" >\u067e\u06cc\u0634\u0631\u0641\u062a\u0647<\/a><\/li><\/ul><\/nav><\/div>\n<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">\u0632\u0645\u0627\u0646 \u0644\u0627\u0632\u0645 \u0628\u0631\u0627\u06cc \u0645\u0637\u0627\u0644\u0639\u0647: <\/span> <span class=\"rt-time\"> 3<\/span> <span class=\"rt-label rt-postfix\">\u062f\u0642\u06cc\u0642\u0647<\/span><\/span><p> <br \/>\n<\/p>\n<div><noscript><\/noscript><\/p>\n<p>\u0631\u0627\u0647 \u0647\u0627\u06cc \u0632\u06cc\u0627\u062f\u06cc \u0628\u0631\u0627\u06cc \u062d\u0644 \u06cc\u06a9 \u0645\u0634\u06a9\u0644 \u062f\u0631 \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f \u0648 \u0627\u06cc\u0646 \u0627\u0645\u0631 \u0628\u0647 \u0648\u06cc\u0698\u0647 \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0635\u0627\u062f\u0642 \u0627\u0633\u062a.  \u0628\u0633\u06cc\u0627\u0631\u06cc \u0627\u0632 \u0627\u0648\u0642\u0627\u062a \u0645\u062a\u0648\u062c\u0647 \u062e\u0648\u0627\u0647\u06cc\u062f \u0634\u062f \u06a9\u0647 \u0686\u0646\u062f\u06cc\u0646 \u0645\u0627\u0698\u0648\u0644 \u062f\u0627\u062e\u0644\u06cc \u06cc\u0627 \u0627\u0633\u062a\u0627\u0646\u062f\u0627\u0631\u062f \u0627\u0633\u0627\u0633\u0627\u064b \u0647\u062f\u0641 \u06cc\u06a9\u0633\u0627\u0646\u06cc \u062f\u0627\u0631\u0646\u062f\u060c \u0627\u0645\u0627 \u0628\u0627 \u0639\u0645\u0644\u06a9\u0631\u062f\u0647\u0627\u06cc \u06a9\u0645\u06cc \u0645\u062a\u0641\u0627\u0648\u062a.  \u0628\u0631\u0631\u0633\u06cc \u0648\u062c\u0648\u062f \u0641\u0627\u06cc\u0644 \u06cc\u0627 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0642\u0637\u0639\u0627 \u06cc\u06a9\u06cc \u0627\u0632 \u0627\u06cc\u0646 \u0645\u0648\u0627\u0631\u062f \u0627\u0633\u062a.<\/p>\n<p>\u062f\u0631 \u0627\u06cc\u0646\u062c\u0627 \u0686\u0646\u062f \u0631\u0627\u0647 \u0628\u0631\u0627\u06cc \u0628\u0631\u0631\u0633\u06cc \u0641\u0627\u06cc\u0644 \u0647\u0627\/\u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u0647\u0627\u06cc \u0645\u0648\u062c\u0648\u062f \u0648 \u062a\u0641\u0627\u0648\u062a \u0647\u0627\u06cc \u0638\u0631\u06cc\u0641 \u0622\u0646\u0647\u0627 \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f.  \u062f\u0631 \u0637\u0648\u0644 \u0627\u06cc\u0646 \u0645\u062b\u0627\u0644 \u0647\u0627 \u0645\u0627 \u0641\u0631\u0636 \u0645\u06cc \u06a9\u0646\u06cc\u0645 <em>\u0641\u0647\u0631\u0633\u062a \u06a9\u0627\u0631 \u0641\u0639\u0644\u06cc<\/em> \u0627\u06cc\u0646 \u0641\u0627\u06cc\u0644 \u0647\u0627 \u0648 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u0647\u0627 \u0631\u0627 \u062f\u0631 \u062e\u0648\u062f \u062f\u0627\u0631\u062f:<\/p>\n<pre><code class=\"hljs\">drwxr-xr-x  3 scott  staff  102 Jan 12 10:01 dir\n-rw-r--r--  1 scott  staff    5 Jan 12 09:56 file.txt\nlrwxr-xr-x  1 scott  staff    8 Jan 12 09:56 link.txt -&gt; file.txt\nlrwxr-xr-x  1 scott  staff    3 Jan 12 10:00 sym -&gt; dir\n<\/code><\/pre>\n<p>\u062a\u0648\u062c\u0647 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u06a9\u0647 \u0645\u0627 \u06cc\u06a9 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u062f\u0627\u0631\u06cc\u0645 (<code>dir<\/code>)\u060c \u06cc\u06a9 \u0641\u0627\u06cc\u0644 (<code>file.txt<\/code>)\u060c \u067e\u06cc\u0648\u0646\u062f \u0646\u0645\u0627\u062f\u06cc\u0646 \u06cc\u06a9 \u0641\u0627\u06cc\u0644 (<code>link.txt<\/code>\u060c \u0648 \u06cc\u06a9 \u067e\u06cc\u0648\u0646\u062f \u0646\u0645\u0627\u062f\u06cc\u0646 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc (<code>sym<\/code>).<\/p>\n<h2 id=\"checkingifafileexists\"><span class=\"ez-toc-section\" id=\"%d8%a8%d8%b1%d8%b1%d8%b3%db%8c_%d9%88%d8%ac%d9%88%d8%af_%d9%81%d8%a7%db%8c%d9%84\"><\/span>\u0628\u0631\u0631\u0633\u06cc \u0648\u062c\u0648\u062f \u0641\u0627\u06cc\u0644<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u0627\u06cc\u0646 \u0628\u062f\u0648\u0646 \u0634\u06a9 \u0633\u0627\u062f\u0647 \u062a\u0631\u06cc\u0646 \u0631\u0627\u0647 \u0628\u0631\u0627\u06cc \u0628\u0631\u0631\u0633\u06cc \u0648\u062c\u0648\u062f \u0647\u0631 \u062f\u0648 \u0641\u0627\u06cc\u0644 \u0627\u0633\u062a <em>\u0648<\/em> \u0627\u06af\u0631 \u0641\u0627\u06cc\u0644 \u0628\u0627\u0634\u062f<\/p>\n<pre><code class=\"hljs\"><span class=\"hljs-keyword\">import<\/span> os\nos.path.isfile(<span class=\"hljs-string\">'.\/file.txt'<\/span>)    \nos.path.isfile(<span class=\"hljs-string\">'.\/link.txt'<\/span>)    \nos.path.isfile(<span class=\"hljs-string\">'.\/fake.txt'<\/span>)    \nos.path.isfile(<span class=\"hljs-string\">'.\/dir'<\/span>)    \nos.path.isfile(<span class=\"hljs-string\">'.\/sym'<\/span>)    \nos.path.isfile(<span class=\"hljs-string\">'.\/foo'<\/span>)    \n<\/code><\/pre>\n<p>\u062a\u0648\u062c\u0647 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u06a9\u0647 <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.python.org\/2\/library\/os.path.html#os.path.isfile\"><code>os.path.isfile<\/code><\/a> <em>\u0645\u06cc\u06a9\u0646\u062f<\/em> \u067e\u06cc\u0648\u0646\u062f\u0647\u0627\u06cc \u0646\u0645\u0627\u062f\u06cc\u0646 \u0631\u0627 \u062f\u0646\u0628\u0627\u0644 \u06a9\u0646\u06cc\u062f\u060c \u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u062f\u0631\u06cc\u0627\u0641\u062a \u0645\u06cc \u06a9\u0646\u06cc\u0645 <code>True<\/code> \u0647\u0646\u06af\u0627\u0645 \u0628\u0631\u0631\u0633\u06cc <code>link.txt<\/code>.<\/p>\n<p><code>isfile<\/code>  \u062f\u0631 \u0648\u0627\u0642\u0639 \u0641\u0642\u0637 \u06cc\u06a9 \u0631\u0648\u0634 \u06a9\u0645\u06a9\u06cc \u0627\u0633\u062a \u06a9\u0647 \u062f\u0631 \u062f\u0627\u062e\u0644 \u0627\u0632 \u0622\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u06a9\u0646\u062f <code>os.stat<\/code> \u0648 <code>stat.S_ISREG(mode)<\/code> \u062f\u0631 \u0632\u06cc\u0631\u060c \u06a9\u0647 \u0645\u0627 \u0622\u0646 \u0631\u0627 \u0644\u0645\u0633 \u0645\u06cc \u06a9\u0646\u06cc\u0645 \u0631\u0648\u06cc \u0628\u0639\u062f.<\/p>\n<h2 id=\"checkingifadirectoryexists\"><span class=\"ez-toc-section\" id=\"%d8%a8%d8%b1%d8%b1%d8%b3%db%8c_%d9%88%d8%ac%d9%88%d8%af_%d8%af%d8%a7%db%8c%d8%b1%da%a9%d8%aa%d9%88%d8%b1%db%8c\"><\/span>\u0628\u0631\u0631\u0633\u06cc \u0648\u062c\u0648\u062f \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u0645\u0627\u0646\u0646\u062f <code>isfile<\/code> \u0631\u0648\u0634\u060c <code>os.path.isdir<\/code> \u0633\u0627\u062f\u0647 \u062a\u0631\u06cc\u0646 \u0631\u0627\u0647 \u0628\u0631\u0627\u06cc \u0628\u0631\u0631\u0633\u06cc \u0627\u06cc\u0646\u06a9\u0647 \u0622\u06cc\u0627 \u06cc\u06a9 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f \u06cc\u0627 \u0627\u06cc\u0646\u06a9\u0647 \u0622\u06cc\u0627 \u0645\u0633\u06cc\u0631 \u062f\u0627\u062f\u0647 \u0634\u062f\u0647 \u06cc\u06a9 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u0627\u0633\u062a\u060c \u0627\u0633\u062a.<\/p>\n<pre><code class=\"hljs\"><span class=\"hljs-keyword\">import<\/span> os\nos.path.isdir(<span class=\"hljs-string\">'.\/file.txt'<\/span>)    \nos.path.isdir(<span class=\"hljs-string\">'.\/link.txt'<\/span>)    \nos.path.isdir(<span class=\"hljs-string\">'.\/fake.txt'<\/span>)    \nos.path.isdir(<span class=\"hljs-string\">'.\/dir'<\/span>)    \nos.path.isdir(<span class=\"hljs-string\">'.\/sym'<\/span>)    \nos.path.isdir(<span class=\"hljs-string\">'.\/foo'<\/span>)    \n<\/code><\/pre>\n<p>\u0628\u0627\u0632 \u0647\u0645 \u062f\u0631\u0633\u062a \u0645\u062b\u0644 <code>isfile<\/code>\u060c <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.python.org\/2\/library\/os.path.html#os.path.isdir\"><code>os.path.isdir<\/code><\/a>  \u067e\u06cc\u0648\u0646\u062f\u0647\u0627\u06cc \u0646\u0645\u0627\u062f\u06cc\u0646 \u0631\u0627 \u062f\u0646\u0628\u0627\u0644 \u0645\u06cc \u06a9\u0646\u062f.  \u0647\u0645\u0686\u0646\u06cc\u0646 \u0641\u0642\u0637 \u06cc\u06a9 \u0628\u0633\u062a\u0647 \u0628\u0646\u062f\u06cc \u0633\u0627\u062f\u0647 \u062f\u0631 \u0627\u0637\u0631\u0627\u0641 \u0627\u0633\u062a <code>os.stat<\/code> \u0648 <code>stat.S_ISDIR(mode)<\/code>\u060c \u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u0634\u0645\u0627 \u0686\u06cc\u0632\u06cc \u0628\u06cc\u0634 \u0627\u0632 \u0631\u0627\u062d\u062a\u06cc \u0627\u0632 \u0622\u0646 \u062f\u0631\u06cc\u0627\u0641\u062a \u0646\u0645\u06cc \u06a9\u0646\u06cc\u062f.<\/p>\n<h2 id=\"checkingifeitherexist\"><span class=\"ez-toc-section\" id=\"%d8%a8%d8%b1%d8%b1%d8%b3%db%8c_%d8%a7%db%8c%d9%86%da%a9%d9%87_%d8%a2%db%8c%d8%a7_%d9%88%d8%ac%d9%88%d8%af_%d8%af%d8%a7%d8%b1%d8%af_%db%8c%d8%a7_%d8%ae%db%8c%d8%b1\"><\/span>\u0628\u0631\u0631\u0633\u06cc \u0627\u06cc\u0646\u06a9\u0647 \u0622\u06cc\u0627 \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f \u06cc\u0627 \u062e\u06cc\u0631<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u0631\u0627\u0647 \u062f\u06cc\u06af\u0631 \u0628\u0631\u0627\u06cc \u0628\u0631\u0631\u0633\u06cc \u0648\u062c\u0648\u062f \u06cc\u06a9 \u0645\u0633\u06cc\u0631 (\u062a\u0627 \u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u0628\u0631\u0627\u06cc\u062a\u0627\u0646 \u0645\u0647\u0645 \u0646\u0628\u0627\u0634\u062f \u06a9\u0647 \u0622\u06cc\u0627 \u0645\u0633\u06cc\u0631 \u0628\u0647 \u06cc\u06a9 \u0641\u0627\u06cc\u0644 \u06cc\u0627 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u0627\u0634\u0627\u0631\u0647 \u062f\u0627\u0631\u062f) \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0622\u0646 \u0627\u0633\u062a. <code>os.path.exists<\/code>.<\/p>\n<pre><code class=\"hljs\"><span class=\"hljs-keyword\">import<\/span> os\nos.path.exists(<span class=\"hljs-string\">'.\/file.txt'<\/span>)    \nos.path.exists(<span class=\"hljs-string\">'.\/link.txt'<\/span>)    \nos.path.exists(<span class=\"hljs-string\">'.\/fake.txt'<\/span>)    \nos.path.exists(<span class=\"hljs-string\">'.\/dir'<\/span>)    \nos.path.exists(<span class=\"hljs-string\">'.\/sym'<\/span>)    \nos.path.exists(<span class=\"hljs-string\">'.\/foo'<\/span>)    \n<\/code><\/pre>\n<p>\u0647\u0645\u0627\u0646\u0637\u0648\u0631 \u06a9\u0647 \u0645\u06cc \u0628\u06cc\u0646\u06cc\u062f\u060c \u0627\u0647\u0645\u06cc\u062a\u06cc \u0646\u062f\u0627\u0631\u062f \u06a9\u0647 \u0645\u0633\u06cc\u0631 \u0628\u0647 \u06cc\u06a9 \u0641\u0627\u06cc\u0644\u060c \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u06cc\u0627 \u067e\u06cc\u0648\u0646\u062f \u0646\u0645\u0627\u062f\u06cc\u0646 \u0627\u0634\u0627\u0631\u0647 \u0645\u06cc \u06a9\u0646\u062f\u060c \u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u062a\u0642\u0631\u06cc\u0628\u0627\u064b \u0645\u0627\u0646\u0646\u062f \u0627\u06cc\u0646 \u0627\u0633\u062a \u06a9\u0647 \u0634\u0645\u0627 \u0627\u0632 \u0622\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u06a9\u0646\u06cc\u062f. <code>isfile(path) or isdir(path)<\/code>.  \u0627\u0645\u0627 \u062f\u0631 \u0648\u0627\u0642\u0639\u060c \u062f\u0631 \u062f\u0627\u062e\u0644 \u0641\u0642\u0637 \u062f\u0631 \u062a\u0644\u0627\u0634 \u0628\u0631\u0627\u06cc \u062a\u0645\u0627\u0633 \u0627\u0633\u062a <code>os.stat(path)<\/code>\u060c \u0648 \u0627\u06af\u0631 \u062e\u0637\u0627\u06cc\u06cc \u0627\u06cc\u062c\u0627\u062f \u0634\u0648\u062f\u060c \u0628\u0631\u0645\u06cc \u06af\u0631\u062f\u062f <code>False<\/code>.<\/p>\n<h2 id=\"advanced\"><span class=\"ez-toc-section\" id=\"%d9%be%db%8c%d8%b4%d8%b1%d9%81%d8%aa%d9%87\"><\/span>\u067e\u06cc\u0634\u0631\u0641\u062a\u0647<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u062f\u0631 \u0637\u0648\u0644 \u0645\u0642\u0627\u0644\u0647 \u0645\u0646 \u0628\u0647 \u0631\u0648\u0634 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062a\u0645\u0627\u0645 \u0631\u0648\u0634 \u0647\u0627\u06cc \u0628\u0627\u0644\u0627 \u0627\u0634\u0627\u0631\u0647 \u06a9\u0631\u062f\u0647 \u0627\u0645 <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.python.org\/2\/library\/os.html#os.stat\"><code>os.stat<\/code><\/a>  \u0631\u0648\u0634\u060c \u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u0645\u0646 \u0641\u06a9\u0631 \u06a9\u0631\u062f\u0645 \u0645\u0641\u06cc\u062f \u0627\u0633\u062a \u06a9\u0647 \u0628\u0647 \u0622\u0646 \u0646\u06af\u0627\u0647\u06cc \u0628\u06cc\u0646\u062f\u0627\u0632\u06cc\u0645.  \u0627\u06cc\u0646 \u06cc\u06a9 \u0631\u0648\u0634 \u0633\u0637\u062d \u067e\u0627\u06cc\u06cc\u0646 \u062a\u0631 \u0627\u0633\u062a \u06a9\u0647 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u062f\u0642\u06cc\u0642\u06cc \u062f\u0631 \u0645\u0648\u0631\u062f \u0641\u0627\u06cc\u0644 \u0647\u0627\u060c \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u0647\u0627\u060c \u0633\u0648\u06a9\u062a \u0647\u0627\u060c \u0628\u0627\u0641\u0631\u0647\u0627 \u0648 \u0645\u0648\u0627\u0631\u062f \u062f\u06cc\u06af\u0631 \u062f\u0631 \u0627\u062e\u062a\u06cc\u0627\u0631 \u0634\u0645\u0627 \u0642\u0631\u0627\u0631 \u0645\u06cc \u062f\u0647\u062f.<\/p>\n<p>\u0645\u0627\u0646\u0646\u062f \u062a\u0645\u0627\u0645 \u0631\u0648\u0634 \u0647\u0627\u06cc \u062f\u06cc\u06af\u0631\u06cc \u06a9\u0647 \u0642\u0628\u0644\u0627\u064b \u067e\u0648\u0634\u0634 \u062f\u0627\u062f\u0647 \u0627\u06cc\u0645\u060c <code>os.stat<\/code> \u067e\u06cc\u0648\u0646\u062f\u0647\u0627\u06cc \u0646\u0645\u0627\u062f\u06cc\u0646 \u0631\u0627 \u062f\u0646\u0628\u0627\u0644 \u0645\u06cc \u06a9\u0646\u062f\u060c \u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u0627\u06af\u0631 \u0645\u06cc \u062e\u0648\u0627\u0647\u06cc\u062f \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0622\u0645\u0627\u0631\u06cc \u0631\u0627 \u062f\u0631\u06cc\u0627\u0641\u062a \u06a9\u0646\u06cc\u062f \u0631\u0648\u06cc \u06cc\u06a9 \u0644\u06cc\u0646\u06a9\u060c \u0633\u0639\u06cc \u06a9\u0646\u06cc\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f <code>os.lstat()<\/code> \u0628\u062c\u0627\u06cc.<\/p>\n<p>\u0627\u0632 \u0622\u0646\u062c\u0627\u06cc\u06cc \u06a9\u0647 \u0647\u0631 \u0633\u06cc\u0633\u062a\u0645 \u0639\u0627\u0645\u0644 \u0645\u062a\u0641\u0627\u0648\u062a \u0627\u0633\u062a\u060c \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc \u0627\u0631\u0627\u0626\u0647 \u0634\u062f\u0647 \u062a\u0648\u0633\u0637 <code>os.stat<\/code> \u0628\u0633\u06cc\u0627\u0631 \u0645\u062a\u0641\u0627\u0648\u062a \u0627\u0633\u062a.  \u062f\u0631 \u0627\u06cc\u0646\u062c\u0627 \u0641\u0642\u0637 \u0628\u0631\u062e\u06cc \u0627\u0632 \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc \u0645\u0634\u062a\u0631\u06a9 \u0647\u0631 \u0633\u06cc\u0633\u062a\u0645 \u0639\u0627\u0645\u0644 \u0622\u0648\u0631\u062f\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a:<\/p>\n<ul>\n<li><code>st_mode<\/code>: \u0628\u06cc\u062a \u0647\u0627\u06cc \u062d\u0641\u0627\u0638\u062a\u06cc<\/li>\n<li><code>st_uid<\/code>: \u0634\u0646\u0627\u0633\u0647 \u06a9\u0627\u0631\u0628\u0631\u06cc \u0645\u0627\u0644\u06a9<\/li>\n<li><code>st_gid<\/code>: \u0634\u0646\u0627\u0633\u0647 \u06af\u0631\u0648\u0647 \u0645\u0627\u0644\u06a9<\/li>\n<li><code>st_size<\/code>: \u0627\u0646\u062f\u0627\u0632\u0647 \u0641\u0627\u06cc\u0644 \u0628\u0631 \u062d\u0633\u0628 \u0628\u0627\u06cc\u062a<\/li>\n<li><code>st_atime<\/code>: \u0632\u0645\u0627\u0646 \u0622\u062e\u0631\u06cc\u0646 \u062f\u0633\u062a\u0631\u0633\u06cc<\/li>\n<li><code>st_mtime<\/code>: \u0632\u0645\u0627\u0646 \u0622\u062e\u0631\u06cc\u0646 \u0627\u0635\u0644\u0627\u062d<\/li>\n<li><code>st_ctime<\/code>: \u0632\u0645\u0627\u0646 \u0622\u062e\u0631\u06cc\u0646 \u062a\u063a\u06cc\u06cc\u0631 \u0627\u0628\u0631\u062f\u0627\u062f\u0647 \u0631\u0648\u06cc \u06cc\u0648\u0646\u06cc\u06a9\u0633 \u06cc\u0627 \u0632\u0645\u0627\u0646 \u062e\u0644\u0642\u062a \u0631\u0648\u06cc \u067e\u0646\u062c\u0631\u0647 \u0647\u0627<\/li>\n<\/ul>\n<p>\u0633\u067e\u0633 \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 \u0627\u06cc\u0646 \u062f\u0627\u062f\u0647 \u0647\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 <code>stat<\/code> \u0645\u0627\u0698\u0648\u0644 \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u062c\u0627\u0644\u0628\u060c \u0645\u0627\u0646\u0646\u062f \u0627\u06cc\u0646\u06a9\u0647 \u0622\u06cc\u0627 \u06cc\u06a9 \u0645\u0633\u06cc\u0631 \u0628\u0647 \u06cc\u06a9 \u0633\u0648\u06a9\u062a \u0627\u0634\u0627\u0631\u0647 \u0645\u06cc \u06a9\u0646\u062f (<code>stat.S_ISSOCK(mode)<\/code>\u060c \u06cc\u0627 \u0627\u06af\u0631 \u06cc\u06a9 \u0641\u0627\u06cc\u0644 \u062f\u0631 \u0648\u0627\u0642\u0639 \u06cc\u06a9 \u0644\u0648\u0644\u0647 \u0628\u0627 \u0646\u0627\u0645 \u0628\u0627\u0634\u062f (<code>stat.S_ISFIFO(mode)<\/code>).<\/p>\n<p>\u0627\u06af\u0631 \u0628\u0647 \u0639\u0645\u0644\u06a9\u0631\u062f\u0647\u0627\u06cc \u067e\u06cc\u0634\u0631\u0641\u062a\u0647 \u062a\u0631\u06cc \u0646\u06cc\u0627\u0632 \u062f\u0627\u0631\u06cc\u062f\u060c \u0627\u06cc\u0646 \u062c\u0627\u06cc\u06cc \u0627\u0633\u062a \u06a9\u0647 \u0628\u0627\u06cc\u062f \u0628\u0631\u0648\u06cc\u062f.  \u0627\u0645\u0627 \u062f\u0631 90 \u062f\u0631\u0635\u062f \u0645\u0648\u0627\u0642\u0639 \u0628\u0627 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u0647\u0627 \u0648 \u0641\u0627\u06cc\u0644 \u0647\u0627 \u0633\u0631 \u0648 \u06a9\u0627\u0631 \u062f\u0627\u0631\u06cc\u062f <code>os<\/code> \u06cc\u0627 <code>os.path<\/code> \u0645\u0627\u0698\u0648\u0644 \u0647\u0627 \u0628\u0627\u06cc\u062f \u0634\u0645\u0627 \u0631\u0627 \u062a\u062d\u062a \u067e\u0648\u0634\u0634 \u0642\u0631\u0627\u0631 \u062f\u0647\u0646\u062f.<\/p>\n<p>\u0627\u06af\u0631\u0686\u0647\u060c \u06cc\u06a9 \u0645\u0648\u0631\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u0639\u062a\u0628\u0631 \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0632\u0645\u0627\u0646\u06cc \u0628\u0627\u0634\u062f \u06a9\u0647 \u062f\u0631 \u062d\u0627\u0644 \u0627\u0646\u062c\u0627\u0645 \u0686\u0646\u062f\u06cc\u0646 \u0622\u0632\u0645\u0627\u06cc\u0634 \u0647\u0633\u062a\u06cc\u062f \u0631\u0648\u06cc \u0647\u0645\u0627\u0646 \u0641\u0627\u06cc\u0644 \u0648 \u0645\u06cc \u062e\u0648\u0627\u0647\u06cc\u062f \u0628\u0631\u0627\u06cc \u062c\u0644\u0648\u06af\u06cc\u0631\u06cc \u0627\u0632 \u0633\u0631\u0628\u0627\u0631 \u0627\u0632 <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/en.wikipedia.org\/wiki\/Stat_%28system_call%29\">\u062a\u0645\u0627\u0633 \u0633\u06cc\u0633\u062a\u0645 \u0622\u0645\u0627\u0631\u06cc<\/a> \u0628\u0631\u0627\u06cc \u0647\u0631 \u0622\u0632\u0645\u0648\u0646  \u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u0627\u06af\u0631 \u0686\u0646\u062f \u0622\u0632\u0645\u0627\u06cc\u0634 \u0628\u0631\u0627\u06cc \u0627\u0646\u062c\u0627\u0645 \u062f\u0627\u062f\u0646 \u062f\u0627\u0631\u06cc\u062f\u060c \u0627\u06cc\u0646 \u0628\u0647 \u0634\u0645\u0627 \u06a9\u0645\u06a9 \u0645\u06cc\u200c\u06a9\u0646\u062f \u0622\u0646 \u0631\u0627 \u0628\u0627 \u06a9\u0627\u0631\u0627\u06cc\u06cc \u0628\u06cc\u0634\u062a\u0631\u06cc \u0627\u0646\u062c\u0627\u0645 \u062f\u0647\u06cc\u062f.<\/p>\n<\/div>\n<p><script>\n                        !function(f,b,e,v,n,t,s)\n                        {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n                        n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n                        if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n                        n.queue=();t=b.createElement(e);t.async=!0;\n                        t.src=v;s=b.getElementsByTagName(e)(0);\n                        s.parentNode.insertBefore(t,s)}(window, document,'script',\n                        'https:\/\/connect.facebook.net\/en_US\/fbevents.js');\n                        fbq('init', '525232124909042');\n                        fbq('track', 'PageView');\n                    <\/script>    (\u0628\u0631\u0686\u0633\u0628\u200c\u0647\u0627 \u0628\u0647 \u062a\u0631\u062c\u0645\u0647)# python<br \/>\n<br \/><br \/>\n<br \/>\u0645\u0646\u062a\u0634\u0631 \u0634\u062f\u0647 \u062f\u0631 1403-01-30 08:48:25<br \/>\n<\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;16709&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;\u0627\u0645\u062a\u06cc\u0627\u0632 \u0634\u0645\u0627 \u0628\u0647 \u0627\u06cc\u0646 \u0645\u0637\u0644\u0628&quot;,&quot;legend&quot;:&quot;0\\\/5 (0 \u0631\u0627\u06cc)&quot;,&quot;size&quot;:&quot;30&quot;,&quot;title&quot;:&quot;\u067e\u0627\u06cc\u062a\u0648\u0646: \u0628\u0631\u0631\u0633\u06cc \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0622\u06cc\u0627 \u06cc\u06a9 \u0641\u0627\u06cc\u0644 \u06cc\u0627 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f \u06cc\u0627 \u062e\u06cc\u0631&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} ({count} \u0631\u0627\u06cc)&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 30px; height: 30px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 24px;\">\n            <span class=\"kksr-muted\">\u0627\u0645\u062a\u06cc\u0627\u0632 \u0634\u0645\u0627 \u0628\u0647 \u0627\u06cc\u0646 \u0645\u0637\u0644\u0628<\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">\u0632\u0645\u0627\u0646 \u0644\u0627\u0632\u0645 \u0628\u0631\u0627\u06cc \u0645\u0637\u0627\u0644\u0639\u0647: <\/span> <span class=\"rt-time\"> 3<\/span> <span class=\"rt-label rt-postfix\">\u062f\u0642\u06cc\u0642\u0647<\/span><\/span>\u0631\u0627\u0647 \u0647\u0627\u06cc \u0632\u06cc\u0627\u062f\u06cc \u0628\u0631\u0627\u06cc \u062d\u0644 \u06cc\u06a9 \u0645\u0634\u06a9\u0644 \u062f\u0631 \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f \u0648 \u0627\u06cc\u0646 \u0627\u0645\u0631 \u0628\u0647 \u0648\u06cc\u0698\u0647 \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0635\u0627\u062f\u0642 \u0627\u0633\u062a. \u0628\u0633\u06cc\u0627\u0631\u06cc \u0627\u0632 \u0627\u0648\u0642\u0627\u062a \u0645\u062a\u0648\u062c\u0647 \u062e\u0648\u0627\u0647\u06cc\u062f \u0634\u062f \u06a9\u0647 \u0686\u0646\u062f\u06cc\u0646 \u0645\u0627\u0698\u0648\u0644 \u062f\u0627\u062e\u0644\u06cc \u06cc\u0627 \u0627\u0633\u062a\u0627\u0646\u062f\u0627\u0631\u062f \u0627\u0633\u0627\u0633\u0627\u064b \u0647\u062f\u0641 \u06cc\u06a9\u0633\u0627\u0646\u06cc \u062f\u0627\u0631\u0646\u062f\u060c \u0627\u0645\u0627 \u0628\u0627 \u0639\u0645\u0644\u06a9\u0631\u062f\u0647\u0627\u06cc \u06a9\u0645\u06cc \u0645\u062a\u0641\u0627\u0648\u062a. \u0628\u0631\u0631\u0633\u06cc \u0648\u062c\u0648\u062f \u0641\u0627\u06cc\u0644 \u06cc\u0627 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0642\u0637\u0639\u0627 \u06cc\u06a9\u06cc \u0627\u0632 \u0627\u06cc\u0646 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":9162,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1743,620],"tags":[],"class_list":["post-16709","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-programming"],"acf":[],"_links":{"self":[{"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/posts\/16709","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/comments?post=16709"}],"version-history":[{"count":0,"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/posts\/16709\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/media\/9162"}],"wp:attachment":[{"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/media?parent=16709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/categories?post=16709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rasanegaar.com\/blog\/wp-json\/wp\/v2\/tags?post=16709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}