{"id":494159,"date":"2026-09-10T06:54:16","date_gmt":"2026-09-10T06:54:16","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=494159"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=494159","title":{"rendered":"\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0430\u044f \u0447\u0438\u0441\u0442\u0438\u043b\u043a\u0430 Temp: \u043a\u0430\u043a \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u0442\u044c"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0417\u0430\u0445\u043b\u0430\u043c\u0438\u043b\u0441\u044f <code>%TEMP%<\/code>, \u043d\u0430\u0431\u0440\u0430\u043b\u043e\u0441\u044c \u0433\u0438\u0433\u043e\u0432 \u043f\u044f\u0442\u044c. \u041d\u0443, \u0434\u0443\u043c\u0430\u044e, \u043d\u0430\u043a\u0438\u0434\u0430\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u043a\u0443 \u2014 \u043a\u043d\u043e\u043f\u043a\u0430 \u00ab\u043f\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c\u00bb \u0434\u0430 \u0433\u0430\u043b\u043a\u0430 \u00ab\u0434\u0435\u043b\u0430\u0439 \u044d\u0442\u043e \u0441\u0430\u043c\u043e \u0440\u0430\u0437 \u0432 \u043d\u0435\u0434\u0435\u043b\u044e\u00bb. \u0414\u0435\u043b \u043d\u0430 \u0432\u0435\u0447\u0435\u0440.<\/p>\n<p>\u0418 \u043f\u0440\u0430\u0432\u0434\u0430 \u043d\u0430 \u0432\u0435\u0447\u0435\u0440. \u0417\u0430\u0434\u0430\u0447\u0430 \u2014 \u043f\u0440\u043e\u0449\u0435 \u043d\u0435\u043a\u0443\u0434\u0430: \u043f\u0440\u043e\u0439\u0442\u0438\u0441\u044c \u043f\u043e \u043f\u0430\u043f\u043a\u0435, \u043f\u043e\u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0441\u0442\u0430\u0440\u043e\u0435. \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u2014 \u043f\u0430\u0440\u0430 \u0441\u043e\u0442\u0435\u043d \u0441\u0442\u0440\u043e\u043a \u043d\u0430 Python. \u041d\u043e \u043f\u043e\u043a\u0430 \u043f\u0438\u0441\u0430\u043b, \u043f\u043e\u043f\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0442\u0443\u043a, \u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c. \u041d\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0435, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0435 \u0438 \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043f\u0440\u0438\u043a\u043e\u043b\u044c\u043d\u044b\u0435. \u0412\u043e\u0442 \u043f\u0440\u043e \u043d\u0438\u0445 \u0438 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c, \u0441\u0430\u043c\u0443 \u0440\u0443\u0442\u0438\u043d\u0443 \u0441 <code>os.remove<\/code> \u044f \u043f\u0440\u043e\u043f\u0443\u0449\u0443. <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/4bc\/dd0\/40c\/4bcdd040c782e30ee6571a12f6cf8782.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/4bc\/dd0\/40c\/4bcdd040c782e30ee6571a12f6cf8782.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/4bc\/dd0\/40c\/4bcdd040c782e30ee6571a12f6cf8782.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>\u00ab\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0441\u0451\u00bb \u043d\u0435 \u043a\u0430\u0442\u0438\u0442 \u2014 \u0438 \u044d\u0442\u043e, \u043f\u043e \u0441\u0443\u0442\u0438, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u0442\u0443\u0442 \u043d\u0430\u0434\u043e \u043f\u043e\u043d\u044f\u0442\u044c<\/h3>\n<p>Temp \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u043e\u043c\u043e\u0439\u043a\u043e\u0439. \u041d\u0430 \u0434\u0435\u043b\u0435 \u0442\u0430\u043c \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043b\u0435\u0436\u0430\u0442 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043a\u0442\u043e-\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f: \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u043b\u0441\u044f \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u044d\u0448 \u0441\u0435\u0441\u0441\u0438\u0438, \u0430\u043f\u0434\u0435\u0439\u0442\u0435\u0440 \u0434\u043e\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0430\u043a\u0435\u0442. \u0421\u043d\u0435\u0441\u0442\u0438 \u0432\u0441\u0451 \u043f\u043e\u0434\u0447\u0438\u0441\u0442\u0443\u044e \u2014 \u0437\u043d\u0430\u0447\u0438\u0442 \u0441 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u043c \u0448\u0430\u043d\u0441\u043e\u043c \u043f\u0440\u0435\u0440\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0434\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u0432\u0441\u0451 \u0432\u044b\u0442\u0435\u043a\u0430\u0435\u0442: <strong>\u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u2014 \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u043c.<\/strong> \u041b\u044e\u0431\u043e\u0435 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u043a\u0442\u0443\u0435\u043c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u00ab\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u00bb. \u0412\u0441\u0451, \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u043e \u043c\u0435\u043b\u043e\u0447\u0430\u043c.<\/p>\n<p>\u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043e\u043d\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0440\u0438 \u0432\u0435\u0449\u0438. \u0421\u0432\u0435\u0436\u0435\u0435 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0435\u043c \u2014 \u0432\u0441\u0451 \u043c\u043e\u043b\u043e\u0436\u0435 \u0441\u0443\u0442\u043e\u043a \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u043d\u0443\u0436\u043d\u043e. \u0417\u0430\u043d\u044f\u0442\u043e\u0435 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0435\u043c \u2014 \u0435\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, Windows \u0441\u0430\u043c \u043d\u0435 \u0434\u0430\u0441\u0442 \u0435\u0433\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c, \u0438 \u0441\u043b\u0430\u0432\u0430 \u0431\u043e\u0433\u0443, \u044f \u0438 \u043d\u0435 \u043b\u0435\u0437\u0443. \u041d\u0443 \u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u2014 \u043c\u0430\u0441\u043a\u0438 \u0442\u0438\u043f\u0430 <code>nvidia*<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0442\u0440\u043e\u043d\u0443\u0442\u0441\u044f \u043d\u0438\u043a\u043e\u0433\u0434\u0430.<\/p>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u0441\u0451. \u0414\u0430\u043b\u044c\u0448\u0435 \u2014 \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u0437\u0430\u043d\u044f\u0442\u043d\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438.<\/p>\n<h3>\u0427\u0442\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u00ab\u0441\u0432\u0435\u0436\u0438\u043c\u00bb \u2014 \u0438 \u0437\u0430\u0431\u0430\u0432\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430 \u043f\u0440\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0432\u0438\u043d\u0434\u0435<\/h3>\n<p>\u041b\u043e\u0433\u0438\u0447\u043d\u043e \u0432\u0437\u044f\u0442\u044c <code>mtime<\/code> \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 \u00ab\u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u0438\u043d\u0443\u0441 \u0441\u0443\u0442\u043a\u0438\u00bb. \u042f \u0440\u0435\u0448\u0438\u043b \u0437\u0430\u043e\u0434\u043d\u043e \u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u2014 \u043d\u0430 \u0432\u0438\u043d\u0434\u0435 \u043e\u043d\u043e \u0432 Python \u043b\u0435\u0436\u0438\u0442 \u0432 <code>st_ctime<\/code> (\u043d\u0430 Unix <code>ctime<\/code> \u043f\u0440\u043e \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u043d\u0430 \u0432\u0438\u043d\u0434\u0435 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u043e \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430).<\/p>\n<p>\u0410 \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u043f\u0440\u0438\u043a\u043e\u043b: \u0432 Python 3.12 \u044d\u0442\u043e \u043f\u043e\u043b\u0435 \u043f\u043e\u0442\u0438\u0445\u043e\u043d\u044c\u043a\u0443 \u0434\u0435\u043f\u0440\u0435\u043a\u0435\u0439\u0442\u044f\u0442 \u2014 \u0437\u0430\u0432\u0435\u0437\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 <code>st_birthtime<\/code>, \u0430 <code>st_ctime<\/code> \u043e\u0431\u0435\u0449\u0430\u044e\u0442 \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043f\u0435\u0440\u0435\u043e\u0441\u043c\u044b\u0441\u043b\u0438\u0442\u044c. \u0413\u0434\u0435-\u0442\u043e \u0434\u0430\u0436\u0435 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u043b\u043e, \u0447\u0442\u043e \u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438\u0437 <code>os.scandir<\/code> \u043d\u0430 \u0432\u0438\u043d\u0434\u0435 <code>ctime<\/code> \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0435\u0445\u0430\u0442\u044c \u043d\u0443\u043b\u0451\u043c.<\/p>\n<p>\u041d\u043e \u043c\u043d\u0435 \u043d\u0430 \u044d\u0442\u043e, \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u043e\u0444\u0438\u0433. \u0421\u043c\u043e\u0442\u0440\u0438: \u0444\u0430\u0439\u043b \u0443 \u043c\u0435\u043d\u044f \u00ab\u0441\u0442\u0430\u0440\u044b\u0439\u00bb, \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0441\u0442\u0430\u0440\u044b <strong>\u043e\u0431\u0435<\/strong> \u043c\u0435\u0442\u043a\u0438. \u0417\u043d\u0430\u0447\u0438\u0442, \u043e\u0434\u043d\u043e\u0439 \u0441\u0432\u0435\u0436\u0435\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0444\u0430\u0439\u043b \u0432\u044b\u0436\u0438\u043b. \u0427\u0442\u043e \u0431\u044b \u043d\u0438 \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441 \u0442\u0440\u0430\u043a\u0442\u043e\u0432\u043a\u043e\u0439 <code>ctime<\/code> \u2014 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f, \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u043e\u043b\u044c, \u0434\u0430 \u0445\u043e\u0442\u044c \u0444\u0430\u0437\u0430 \u043b\u0443\u043d\u044b \u2014 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0435\u0434\u0435\u0442 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u00ab\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u00bb. \u0422\u043e \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0432\u0441\u0451 \u0440\u0430\u0437\u0440\u0443\u043b\u0438\u0432\u0430\u0435\u0442 \u0437\u0430 \u043c\u0435\u043d\u044f.<\/p>\n<pre><code class=\"python\"># \u0432\u044b\u0436\u0438\u0432\u0430\u0435\u0442, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u044c \u043e\u0434\u043d\u0430 \u043c\u0435\u0442\u043a\u0430 \u0441\u0432\u0435\u0436\u0430\u044fif st.st_mtime &gt;= cutoff or st.st_ctime &gt;= cutoff:    stats[\"fresh\"] += 1    continue<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041c\u043d\u0435 \u0442\u0443\u0442 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043d\u0435 \u043a\u043e\u0434, \u0430 \u043f\u043e\u0434\u0445\u043e\u0434: \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0432 API \u043f\u0440\u043e\u0449\u0435 \u043d\u0435 \u0440\u0435\u0448\u0430\u0442\u044c, \u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u0430 \u0447\u0442\u043e-\u043b\u0438\u0431\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u044c.<\/p>\n<h3>\u041f\u043e \u0441\u0438\u043c\u043b\u0438\u043d\u043a\u0430\u043c \u043d\u0435 \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0432\u0430\u044e\u0441\u044c<\/h3>\n<p>\u041e\u0431\u0445\u043e\u0434 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439, \u0438 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 Temp \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u0438\u043c\u043b\u0438\u043d\u043a \u0438\u043b\u0438 junction, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0432 \u00ab\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b\u00bb. \u041d\u0430\u0438\u0432\u043d\u044b\u0439 \u043e\u0431\u0445\u043e\u0434 \u0442\u0443\u0434\u0430 \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0442\u0441\u044f \u0438 \u043d\u0430\u0447\u043d\u0451\u0442 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0443\u0436\u0435 \u043d\u0435 \u0438\u0437 Temp. \u041d\u0435 \u0445\u043e\u0447\u0443.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u0435\u0440\u0435\u0434 \u0441\u0442\u0430\u0440\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e \u0441\u0430\u043c\u0443 \u043f\u0430\u043f\u043a\u0443: \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e \u043f\u0443\u0442\u044c \u0434\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u0442\u0440\u0435\u0431\u0443\u044e, \u0447\u0442\u043e\u0431\u044b \u0432 \u043d\u0451\u043c \u0431\u044b\u043b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>Temp<\/code>\/<code>Tmp<\/code>, \u0438 \u043e\u0442\u0431\u0438\u0432\u0430\u044e \u043a\u043e\u0440\u0435\u043d\u044c \u0434\u0438\u0441\u043a\u0430 \u0438 \u0434\u043e\u043c\u0430\u0448\u043d\u044e\u044e \u043f\u0430\u043f\u043a\u0443 \u2014 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u0435\u0441\u043b\u0438 <code>%TEMP%<\/code> \u0432\u0434\u0440\u0443\u0433 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u044b\u043c \u0438 \u043e\u0431\u0445\u043e\u0434 \u0441\u0442\u0430\u0440\u0442\u0430\u043d\u0451\u0442 \u043d\u0435 \u043e\u0442\u0442\u0443\u0434\u0430.<\/p>\n<pre><code class=\"python\">def check_root(path):    real = os.path.realpath(path)              # \u0440\u0430\u0441\u043a\u0440\u044b\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0438    _, tail = os.path.splitdrive(real)    parts = [p for p in tail.replace(\"\/\", \"\\\\\").split(\"\\\\\") if p]    if not parts:        return \"\u043a\u043e\u0440\u0435\u043d\u044c \u0434\u0438\u0441\u043a\u0430 \u2014 \u043d\u0435\u0442\"    if not any(p.lower() in (\"temp\", \"tmp\") for p in parts):        return \"\u0432 \u043f\u0443\u0442\u0438 \u043d\u0435\u0442 Temp \u2014 \u043d\u0435\u0442\"    if real.rstrip(\"\\\\\/\").lower() == os.path.realpath(            os.path.expanduser(\"~\")).rstrip(\"\\\\\/\").lower():        return \"\u0434\u043e\u043c\u0430\u0448\u043d\u044f\u044f \u043f\u0430\u043f\u043a\u0430 \u2014 \u043d\u0435\u0442\"    return None<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0410 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043f\u0440\u0438 \u043e\u0431\u0445\u043e\u0434\u0435 \u043b\u044e\u0431\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 (junction \u043d\u0430 \u0432\u0438\u043d\u0434\u0435 \u0432\u0438\u0434\u043d\u043e \u043f\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0443 <code>FILE_ATTRIBUTE_REPARSE_POINT<\/code>) \u0443\u0434\u0430\u043b\u044f\u044e \u043a\u0430\u043a \u0441\u0441\u044b\u043b\u043a\u0443, \u043d\u043e \u0432\u043d\u0443\u0442\u0440\u044c \u043f\u043e \u043d\u0435\u0439 \u043d\u0435 \u0437\u0430\u0445\u043e\u0436\u0443. \u0418, \u0447\u0438\u0441\u0442\u043e \u0434\u043b\u044f \u0441\u043f\u043e\u043a\u043e\u0439\u0441\u0442\u0432\u0438\u044f, \u043f\u0435\u0440\u0435\u0434 \u0441\u043f\u0443\u0441\u043a\u043e\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0435\u0449\u0451 \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e \u0447\u0435\u0440\u0435\u0437 <code>lstat<\/code>, \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u0441\u0451 \u0435\u0449\u0451 \u043f\u0430\u043f\u043a\u0430, \u0430 \u043d\u0435 \u043f\u043e\u0434\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0439 \u0437\u0430 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0441\u0438\u043c\u043b\u0438\u043d\u043a (\u0442\u0430 \u0441\u0430\u043c\u0430\u044f \u0433\u043e\u043d\u043a\u0430 <a href=\"https:\/\/cwe.mitre.org\/data\/definitions\/367.html\" rel=\"noopener nofollow\">TOCTOU<\/a>). \u0420\u0435\u0430\u043b\u044c\u043d\u043e \u044d\u0442\u043e \u043a\u0442\u043e-\u0442\u043e \u043f\u0440\u043e\u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0438\u0440\u0443\u0435\u0442 \u0432\u0440\u044f\u0434 \u043b\u0438, \u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432 \u0442\u0440\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u2014 \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435\u0442.<\/p>\n<pre><code class=\"python\">if is_dir:    st2 = os.lstat(entry.path)          # \u0441\u0432\u0435\u0436\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0435\u0440\u0435\u0434 \u0441\u043f\u0443\u0441\u043a\u043e\u043c    if not stat.S_ISDIR(st2.st_mode) or \\       st2.st_file_attributes &amp; stat.FILE_ATTRIBUTE_REPARSE_POINT:        continue    clean_dir(entry.path)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h3>\u041f\u0430\u0440\u0430 \u043f\u0440\u0438\u043a\u043e\u043b\u043e\u0432 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435<\/h3>\n<p>\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0445\u0440\u0430\u043d\u044e \u0432 JSON \u0440\u044f\u0434\u043e\u043c \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439. \u0418 \u0442\u0443\u0442 \u0434\u0432\u0430 \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u043d\u044f \u0441\u043b\u0435\u0433\u043a\u0430 \u0443\u0434\u0438\u0432\u0438\u043b\u0438.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439: \u0437\u0430\u0445\u043e\u0442\u0435\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0440\u044f\u0434\u043e\u043c \u0441 exe. \u041f\u0438\u0448\u0443 <code>os.access(path, os.W_OK)<\/code> \u2014 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u00ab\u043c\u043e\u0436\u043d\u043e\u00bb. \u0412\u0441\u0435\u0433\u0434\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u00ab\u043c\u043e\u0436\u043d\u043e\u00bb. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043d\u0430 \u0432\u0438\u043d\u0434\u0435 <code>os.access<\/code> \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u0442\u043e\u043b\u043a\u043e\u043c \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u0432 ACL \u0438 \u0434\u043b\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043f\u0430\u043f\u043a\u0438 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>True<\/code>. \u0422\u043e \u0435\u0441\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u0430\u0432 \u043e\u043d \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u0435\u043d. \u041d\u0443 \u043b\u0430\u0434\u043d\u043e, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e \u0447\u0435\u0441\u0442\u043d\u043e \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0431\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u0438\u043a:<\/p>\n<pre><code class=\"python\">def _probe_writable(d):    probe = d \/ f\".probe_{os.getpid()}.tmp\"    try:        probe.write_text(\"1\"); probe.unlink()        return True    except OSError:        return False<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435. \u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u043a\u043e\u043d\u0444\u0438\u0433 \u043f\u043e\u0431\u0438\u043b\u0441\u044f \u0438\u043b\u0438 \u0435\u0433\u043e \u043d\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0437\u0430\u043b\u043e\u0447\u0438\u043b \u0430\u043d\u0442\u0438\u0432\u0438\u0440\u0443\u0441? \u041b\u0435\u0433\u043a\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0434\u0443\u043c\u0430\u0435\u0442 \u00ab\u043d\u0435 \u0441\u043c\u043e\u0433 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u2014 \u0432\u043e\u0437\u044c\u043c\u0443 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435\u00bb \u0438 \u0441\u043d\u0435\u0441\u0451\u0442 \u0440\u043e\u0432\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043f\u043e\u043c\u0435\u0442\u0438\u043b \u00ab\u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0442\u044c\u00bb. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e \u0442\u0440\u0438 \u0441\u043b\u0443\u0447\u0430\u044f: \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b, \u0444\u0430\u0439\u043b\u0430 \u043d\u0435\u0442 (\u0431\u0435\u0440\u0443 \u0434\u0435\u0444\u043e\u043b\u0442), \u0444\u0430\u0439\u043b \u0435\u0441\u0442\u044c \u043d\u043e \u043d\u0435 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0447\u0438\u0449\u0443 \u0432\u043e\u043e\u0431\u0449\u0435:<\/p>\n<pre><code class=\"python\">patterns = get_excludes()if patterns is None:            # \u0444\u0430\u0439\u043b \u0435\u0441\u0442\u044c, \u043d\u043e \u043d\u0435 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f    return {\"error\": \"\u043a\u043e\u043d\u0444\u0438\u0433 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u2014 \u043e\u0447\u0438\u0441\u0442\u043a\u0443 \u043e\u0442\u043c\u0435\u043d\u044f\u044e\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041b\u0443\u0447\u0448\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u043e\u043a, \u0447\u0435\u043c \u0441\u0442\u0435\u0440\u0435\u0442\u044c \u043d\u0435 \u0442\u043e. \u0412\u0441\u0451 \u0442\u043e \u0436\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0431\u043e\u043a\u0443.<\/p>\n<h3>\u0410 \u0432\u043e\u0442 \u044d\u0442\u043e \u2014 \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435: \u0447\u0438\u0441\u0442\u0438\u043c \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0431\u0435\u0437 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438<\/h3>\n<p>\u0420\u0430\u0434\u0438 \u044d\u0442\u043e\u0433\u043e, \u043f\u043e \u0441\u0443\u0442\u0438, \u0438 \u0437\u0430\u0442\u0435\u0432\u0430\u043b\u043e\u0441\u044c \u00ab\u0432\u043a\u043b\u044e\u0447\u0438\u043b \u0438 \u0437\u0430\u0431\u044b\u043b\u00bb.<\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443, \u2014 \u0441\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u0442\u0440\u0435\u0439 \u0438 \u043a\u0440\u0443\u0442\u0438\u0442\u044c \u0442\u0430\u0439\u043c\u0435\u0440. \u041d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0440\u0430\u0434\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0440\u0430\u0437 \u0432 \u043d\u0435\u0434\u0435\u043b\u044e \u2014 \u044d\u0442\u043e \u043a\u0430\u043a \u043f\u043e\u0441\u0430\u0434\u0438\u0442\u044c \u043e\u0445\u0440\u0430\u043d\u043d\u0438\u043a\u0430 \u0443 \u043c\u0443\u0441\u043e\u0440\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0440\u0430\u0437 \u0432 \u0441\u0435\u043c\u044c \u0434\u043d\u0435\u0439 \u0432\u044b\u043d\u043e\u0441\u0438\u043b \u043f\u0430\u043a\u0435\u0442. \u041d\u0435 \u0445\u043e\u0447\u0443.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u044f \u043e\u0442\u0434\u0430\u043b \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0430 \u043f\u0440\u043e\u0433\u0443 \u0441\u0434\u0435\u043b\u0430\u043b \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u043e\u0439. \u0414\u0432\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430, \u043e\u0431\u0430 \u0437\u043e\u0432\u0443\u0442 \u0435\u0451 \u0441 \u0444\u043b\u0430\u0433\u043e\u043c <code>--clean-if-due<\/code>. \u0417\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 \u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0435, \u0440\u0430\u0437 \u0432 \u0434\u0435\u043d\u044c:<\/p>\n<pre><code>schtasks \/Create \/F \/TN TempCleanerAuto \/SC DAILY \/ST 12:00 ^         \/TR \"TempCleaner.exe --clean-if-due\"<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0418 \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0432 <code>HKCU\\...\\Run<\/code> \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u0435\u0441\u043b\u0438 \u0432 \u043f\u043e\u043b\u0434\u0435\u043d\u044c \u043a\u043e\u043c\u043f \u0431\u044b\u043b \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d.<\/p>\n<p>\u0410 \u0432\u0435\u0441\u044c \u0441\u043c\u044b\u0441\u043b \u0444\u043b\u0430\u0433\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0430 \u0441\u0430\u043c\u0430 \u0441\u043c\u043e\u0442\u0440\u0438\u0442, \u043f\u043e\u0440\u0430 \u043b\u0438, \u0438 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u043e\u0441\u043b\u0435 \u0441\u0435\u0431\u044f \u043d\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f:<\/p>\n<pre><code class=\"python\">if \"--clean-if-due\" in sys.argv:    cfg = read_cfg()    days = cfg.get(\"schedule_days\", 0)    last = cfg.get(\"last_run\", 0)    if days and time.time() - last &gt;= days * 86400 - 3600:        run_clean()    sys.exit(0)     # \u0440\u0430\u043d\u043e \u2014 \u0432\u044b\u0448\u043b\u0438, \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0443\u0441\u0442\u043e<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0418 \u0442\u0443\u0442 \u0432\u044b\u043b\u0435\u0437 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u2014 \u043d\u0435 \u043f\u0440\u043e \u043a\u043e\u0434, \u043f\u0440\u043e \u043b\u044e\u0434\u0435\u0439. \u0414\u0430\u043b \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u043c\u0443 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c, \u043e\u043d \u0447\u0435\u0440\u0435\u0437 \u0434\u0435\u043d\u044c \u043f\u0438\u0448\u0435\u0442: \u00ab\u0441\u043b\u0443\u0448\u0430\u0439, \u0430 \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u043e\u043e\u0431\u0449\u0435? \u044f \u0435\u0433\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u0445 \u043d\u0435 \u0432\u0438\u0436\u0443\u00bb. \u0418 \u043e\u043d \u043f\u0440\u0430\u0432 \u2014 \u043d\u0435 \u0432\u0438\u0434\u0438\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0435\u0447\u0435\u0433\u043e, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442-\u0442\u043e \u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a.<\/p>\n<p>\u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u043e\u0435 \u0432\u0438\u0434\u0438\u043c\u044b\u043c: \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u0436\u0434\u0430\u044f \u0442\u0438\u0445\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442\u0441\u044f, \u0438 \u0432\u043d\u0438\u0437\u0443 \u043e\u043a\u043d\u0430 \u0432\u0438\u0441\u0438\u0442 \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0442\u0438\u043f\u0430 \u00ab\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0430\u0432\u0442\u043e\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430: \u0441\u0435\u0433\u043e\u0434\u043d\u044f, 08:44 \u2014 \u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0431\u044b\u043b\u043e \u0435\u0449\u0451 \u0440\u0430\u043d\u043e\u00bb. \u0421\u0432\u0435\u0436\u0430\u044f \u0434\u0430\u0442\u0430 \u2014 \u0438 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0441\u043f\u043e\u043a\u043e\u0435\u043d. \u0424\u0438\u0447\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e, \u0430 \u0434\u043b\u044f \u0434\u043e\u0432\u0435\u0440\u0438\u044f \u2014 \u0432\u0441\u0451.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/be1\/d52\/ac6\/be1d52ac6d3686d3f5955f8f9f4f74d5.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/be1\/d52\/ac6\/be1d52ac6d3686d3f5955f8f9f4f74d5.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/be1\/d52\/ac6\/be1d52ac6d3686d3f5955f8f9f4f74d5.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>\u0421\u043e\u0431\u0440\u0430\u0442\u044c \u0438 \u043e\u0442\u0434\u0430\u0442\u044c<\/h3>\n<p>\u0421\u043a\u0438\u0434\u044b\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c <code>python temp_cleaner.pyw<\/code> \u2014 \u043d\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043d\u0443\u0436\u0435\u043d \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a.<\/p>\n<p>exe \u0441\u043e\u0431\u0438\u0440\u0430\u044e <a href=\"https:\/\/pyinstaller.org\/\" rel=\"noopener nofollow\">PyInstaller<\/a>\u2019\u043e\u043c (\u0440\u0435\u0436\u0438\u043c onedir, \u0431\u0435\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438), \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0442\u043e\u0440 \u2014 \u043d\u0430 <a href=\"https:\/\/nsis.sourceforge.io\/\" rel=\"noopener nofollow\">NSIS<\/a>. \u0421\u0442\u0430\u0432\u043b\u044e \u0432 \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0431\u0435\u0437 \u043f\u0440\u0430\u0432 \u0430\u0434\u043c\u0438\u043d\u0430 \u2014 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u043b\u0435\u0437\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u0432\u043e\u0439 Temp, \u0434\u0451\u0440\u0433\u0430\u0442\u044c \u0440\u0430\u0434\u0438 \u044d\u0442\u043e\u0433\u043e UAC \u043a\u0430\u043a-\u0442\u043e \u043d\u0435\u043f\u0440\u0438\u043b\u0438\u0447\u043d\u043e. \u0414\u0435\u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0443\u0431\u0438\u0440\u0430\u0435\u0442 \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430, \u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0438\u0437 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, PyInstaller \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 Windows-exe \u043f\u043e\u0434 Wine \u043d\u0430 Linux \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u0438\u043d\u0434\u0430 \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0430\u0441\u044c. \u041f\u043e\u0434\u043f\u0438\u0441\u0438, \u043f\u0440\u0430\u0432\u0434\u0430, \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043b\u044e\u0434\u0438 \u0441\u043b\u043e\u0432\u044f\u0442 SmartScreen \u0441 \u00ab\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0438\u0437\u0434\u0430\u0442\u0435\u043b\u044c\u00bb; \u044d\u0442\u043e \u044f \u0447\u0435\u0441\u0442\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0432 README.<\/p>\n<h3>\u0418\u0442\u043e\u0433\u043e<\/h3>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0432 \u044d\u0442\u043e\u0439 \u043c\u0435\u043b\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u043a\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435 \u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432, \u0430 \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0435\u0433\u043e: \u0433\u0434\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u043d\u0435 \u0432\u044b\u0439\u0442\u0438 \u0437\u0430 \u043f\u0430\u043f\u043a\u0443, \u043a\u0430\u043a \u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f, \u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0431\u0438\u043b\u0438\u0441\u044c, \u0438 \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u043e\u043d\u043e\u0432\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u043d\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043b\u0438\u0448\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e, \u043d\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043d\u0430\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u043f\u0443\u043d\u043a\u0442\u043e\u043c \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u043e.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0447\u0442\u043e \u0438 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u043f\u043e\u0441\u0442\u0430 \u2014 \u0442\u043e \u043c\u044b\u0441\u043b\u044c, \u0447\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u0438\u0440\u0430\u0435\u0442, \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u043c \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c. \u041a\u043e\u043f\u0435\u0439\u043a\u0438 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 \u0440\u0430\u0441\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c.<\/p>\n<p>\u041a\u043e\u0434 \u043e\u0442\u043a\u0440\u044b\u0442 (MIT), \u0441\u0431\u043e\u0440\u043a\u0430 \u2014 \u0432 \u0440\u0435\u043b\u0438\u0437\u0430\u0445: <a href=\"https:\/\/github.com\/MedveDux\/TempCleaner\" rel=\"noopener nofollow\"><strong>GitHub<\/strong><\/a>. \u041d\u0430\u0439\u0434\u0451\u0448\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439, \u0433\u0434\u0435 \u043e\u043d\u043e \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u043c\u0438\u043c\u043e \u043f\u0440\u0430\u0432\u0438\u043b \u2014 \u043a\u0438\u0434\u0430\u0439 issue.<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1080632\/\">https:\/\/habr.com\/ru\/articles\/1080632\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u0445\u043b\u0430\u043c\u0438\u043b\u0441\u044f %TEMP%, \u043d\u0430\u0431\u0440\u0430\u043b\u043e\u0441\u044c \u0433\u0438\u0433\u043e\u0432 \u043f\u044f\u0442\u044c. \u041d\u0443, \u0434\u0443\u043c\u0430\u044e, \u043d\u0430\u043a\u0438\u0434\u0430\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u043a\u0443 \u2014 \u043a\u043d\u043e\u043f\u043a\u0430 \u00ab\u043f\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c\u00bb \u0434\u0430 \u0433\u0430\u043b\u043a\u0430 \u00ab\u0434\u0435\u043b\u0430\u0439 \u044d\u0442\u043e \u0441\u0430\u043c\u043e \u0440\u0430\u0437 \u0432 \u043d\u0435\u0434\u0435\u043b\u044e\u00bb. \u0414\u0435\u043b \u043d\u0430 \u0432\u0435\u0447\u0435\u0440.\u0418 \u043f\u0440\u0430\u0432\u0434\u0430 \u043d\u0430 \u0432\u0435\u0447\u0435\u0440. \u0417\u0430\u0434\u0430\u0447\u0430 \u2014 \u043f\u0440\u043e\u0449\u0435 \u043d\u0435\u043a\u0443\u0434\u0430: \u043f\u0440\u043e\u0439\u0442\u0438\u0441\u044c \u043f\u043e \u043f\u0430\u043f\u043a\u0435, \u043f\u043e\u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0441\u0442\u0430\u0440\u043e\u0435. \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u2014 \u043f\u0430\u0440\u0430 \u0441\u043e\u0442\u0435\u043d \u0441\u0442\u0440\u043e\u043a \u043d\u0430 Python. \u041d\u043e \u043f\u043e\u043a\u0430 \u043f\u0438\u0441\u0430\u043b, \u043f\u043e\u043f\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0442\u0443\u043a, \u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c. \u041d\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0435, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0435 \u0438 \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043f\u0440\u0438\u043a\u043e\u043b\u044c\u043d\u044b\u0435. \u0412\u043e\u0442 \u043f\u0440\u043e \u043d\u0438\u0445 \u0438 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c, \u0441\u0430\u043c\u0443 \u0440\u0443\u0442\u0438\u043d\u0443 \u0441 os.remove \u044f \u043f\u0440\u043e\u043f\u0443\u0449\u0443. \u00ab\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0441\u0451\u00bb \u043d\u0435 \u043a\u0430\u0442\u0438\u0442 \u2014 \u0438 \u044d\u0442\u043e, \u043f\u043e \u0441\u0443\u0442\u0438, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u0442\u0443\u0442 \u043d\u0430\u0434\u043e \u043f\u043e\u043d\u044f\u0442\u044cTemp \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u043e\u043c\u043e\u0439\u043a\u043e\u0439. \u041d\u0430 \u0434\u0435\u043b\u0435 \u0442\u0430\u043c \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043b\u0435\u0436\u0430\u0442 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043a\u0442\u043e-\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f: \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u043b\u0441\u044f \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u044d\u0448 \u0441\u0435\u0441\u0441\u0438\u0438, \u0430\u043f\u0434\u0435\u0439\u0442\u0435\u0440 \u0434\u043e\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0430\u043a\u0435\u0442. \u0421\u043d\u0435\u0441\u0442\u0438 \u0432\u0441\u0451 \u043f\u043e\u0434\u0447\u0438\u0441\u0442\u0443\u044e \u2014 \u0437\u043d\u0430\u0447\u0438\u0442 \u0441 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u043c \u0448\u0430\u043d\u0441\u043e\u043c \u043f\u0440\u0435\u0440\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435.\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0434\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u0432\u0441\u0451 \u0432\u044b\u0442\u0435\u043a\u0430\u0435\u0442: \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u2014 \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u043c. \u041b\u044e\u0431\u043e\u0435 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u043a\u0442\u0443\u0435\u043c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u00ab\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u00bb. \u0412\u0441\u0451, \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u043e \u043c\u0435\u043b\u043e\u0447\u0430\u043c.\u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043e\u043d\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0440\u0438 \u0432\u0435\u0449\u0438. \u0421\u0432\u0435\u0436\u0435\u0435 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0435\u043c \u2014 \u0432\u0441\u0451 \u043c\u043e\u043b\u043e\u0436\u0435 \u0441\u0443\u0442\u043e\u043a \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u043d\u0443\u0436\u043d\u043e. \u0417\u0430\u043d\u044f\u0442\u043e\u0435 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0435\u043c \u2014 \u0435\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, Windows \u0441\u0430\u043c \u043d\u0435 \u0434\u0430\u0441\u0442 \u0435\u0433\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c, \u0438 \u0441\u043b\u0430\u0432\u0430 \u0431\u043e\u0433\u0443, \u044f \u0438 \u043d\u0435 \u043b\u0435\u0437\u0443. \u041d\u0443 \u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u2014 \u043c\u0430\u0441\u043a\u0438 \u0442\u0438\u043f\u0430 nvidia*, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0442\u0440\u043e\u043d\u0443\u0442\u0441\u044f \u043d\u0438\u043a\u043e\u0433\u0434\u0430.\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u0441\u0451. \u0414\u0430\u043b\u044c\u0448\u0435 \u2014 \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u0437\u0430\u043d\u044f\u0442\u043d\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438.\u0427\u0442\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u00ab\u0441\u0432\u0435\u0436\u0438\u043c\u00bb \u2014 \u0438 \u0437\u0430\u0431\u0430\u0432\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430 \u043f\u0440\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0432\u0438\u043d\u0434\u0435\u041b\u043e\u0433\u0438\u0447\u043d\u043e \u0432\u0437\u044f\u0442\u044c mtime \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 \u00ab\u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u0438\u043d\u0443\u0441 \u0441\u0443\u0442\u043a\u0438\u00bb. \u042f \u0440\u0435\u0448\u0438\u043b \u0437\u0430\u043e\u0434\u043d\u043e \u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u2014 \u043d\u0430 \u0432\u0438\u043d\u0434\u0435 \u043e\u043d\u043e \u0432 Python \u043b\u0435\u0436\u0438\u0442 \u0432 st_ctime (\u043d\u0430 Unix ctime \u043f\u0440\u043e \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u043d\u0430 \u0432\u0438\u043d\u0434\u0435 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u043e \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430).\u0410 \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u043f\u0440\u0438\u043a\u043e\u043b: \u0432 Python 3.12 \u044d\u0442\u043e \u043f\u043e\u043b\u0435 \u043f\u043e\u0442\u0438\u0445\u043e\u043d\u044c\u043a\u0443 \u0434\u0435\u043f\u0440\u0435\u043a\u0435\u0439\u0442\u044f\u0442 \u2014 \u0437\u0430\u0432\u0435\u0437\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 st_birthtime, \u0430 st_ctime \u043e\u0431\u0435\u0449\u0430\u044e\u0442 \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043f\u0435\u0440\u0435\u043e\u0441\u043c\u044b\u0441\u043b\u0438\u0442\u044c. \u0413\u0434\u0435-\u0442\u043e \u0434\u0430\u0436\u0435 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u043b\u043e, \u0447\u0442\u043e \u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438\u0437 os.scandir \u043d\u0430 \u0432\u0438\u043d\u0434\u0435 ctime \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0435\u0445\u0430\u0442\u044c \u043d\u0443\u043b\u0451\u043c.\u041d\u043e \u043c\u043d\u0435 \u043d\u0430 \u044d\u0442\u043e, \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u043e\u0444\u0438\u0433. \u0421\u043c\u043e\u0442\u0440\u0438: \u0444\u0430\u0439\u043b \u0443 \u043c\u0435\u043d\u044f \u00ab\u0441\u0442\u0430\u0440\u044b\u0439\u00bb, \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0441\u0442\u0430\u0440\u044b \u043e\u0431\u0435 \u043c\u0435\u0442\u043a\u0438. \u0417\u043d\u0430\u0447\u0438\u0442, \u043e\u0434\u043d\u043e\u0439 \u0441\u0432\u0435\u0436\u0435\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0444\u0430\u0439\u043b \u0432\u044b\u0436\u0438\u043b. \u0427\u0442\u043e \u0431\u044b \u043d\u0438 \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441 \u0442\u0440\u0430\u043a\u0442\u043e\u0432\u043a\u043e\u0439 ctime \u2014 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f, \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u043e\u043b\u044c, \u0434\u0430 \u0445\u043e\u0442\u044c \u0444\u0430\u0437\u0430 \u043b\u0443\u043d\u044b \u2014 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0435\u0434\u0435\u0442 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u00ab\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u00bb. \u0422\u043e \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0432\u0441\u0451 \u0440\u0430\u0437\u0440\u0443\u043b\u0438\u0432\u0430\u0435\u0442 \u0437\u0430 \u043c\u0435\u043d\u044f.# \u0432\u044b\u0436\u0438\u0432\u0430\u0435\u0442, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u044c \u043e\u0434\u043d\u0430 \u043c\u0435\u0442\u043a\u0430 \u0441\u0432\u0435\u0436\u0430\u044fif st.st_mtime &gt;= cutoff or st.st_ctime &gt;= cutoff:    stats[&#171;fresh&#187;] += 1    continue\u041c\u043d\u0435 \u0442\u0443\u0442 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043d\u0435 \u043a\u043e\u0434, \u0430 \u043f\u043e\u0434\u0445\u043e\u0434: \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0432 API \u043f\u0440\u043e\u0449\u0435 \u043d\u0435 \u0440\u0435\u0448\u0430\u0442\u044c, \u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u0430 \u0447\u0442\u043e-\u043b\u0438\u0431\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u044c.\u041f\u043e \u0441\u0438\u043c\u043b\u0438\u043d\u043a\u0430\u043c \u043d\u0435 \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0432\u0430\u044e\u0441\u044c\u041e\u0431\u0445\u043e\u0434 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439, \u0438 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 Temp \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u0438\u043c\u043b\u0438\u043d\u043a \u0438\u043b\u0438 junction, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0432 \u00ab\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b\u00bb. \u041d\u0430\u0438\u0432\u043d\u044b\u0439 \u043e\u0431\u0445\u043e\u0434 \u0442\u0443\u0434\u0430 \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0442\u0441\u044f \u0438 \u043d\u0430\u0447\u043d\u0451\u0442 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0443\u0436\u0435 \u043d\u0435 \u0438\u0437 Temp. \u041d\u0435 \u0445\u043e\u0447\u0443.\u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u0435\u0440\u0435\u0434 \u0441\u0442\u0430\u0440\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e \u0441\u0430\u043c\u0443 \u043f\u0430\u043f\u043a\u0443: \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e \u043f\u0443\u0442\u044c \u0434\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u0442\u0440\u0435\u0431\u0443\u044e, \u0447\u0442\u043e\u0431\u044b \u0432 \u043d\u0451\u043c \u0431\u044b\u043b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Temp\/Tmp, \u0438 \u043e\u0442\u0431\u0438\u0432\u0430\u044e \u043a\u043e\u0440\u0435\u043d\u044c \u0434\u0438\u0441\u043a\u0430 \u0438 \u0434\u043e\u043c\u0430\u0448\u043d\u044e\u044e \u043f\u0430\u043f\u043a\u0443 \u2014 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u0435\u0441\u043b\u0438 %TEMP% \u0432\u0434\u0440\u0443\u0433 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u044b\u043c \u0438 \u043e\u0431\u0445\u043e\u0434 \u0441\u0442\u0430\u0440\u0442\u0430\u043d\u0451\u0442 \u043d\u0435 \u043e\u0442\u0442\u0443\u0434\u0430.def check_root(path):    real = os.path.realpath(path)              # \u0440\u0430\u0441\u043a\u0440\u044b\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0438    _, tail = os.path.splitdrive(real)    parts = [p for p in tail.replace(&#171;\/&#187;, &#171;\\\\&#187;).split(&#171;\\\\&#187;) if p]    if not parts:        return &#171;\u043a\u043e\u0440\u0435\u043d\u044c \u0434\u0438\u0441\u043a\u0430 \u2014 \u043d\u0435\u0442&#187;    if not any(p.lower() in (&#171;temp&#187;, &#171;tmp&#187;) for p in parts):        return &#171;\u0432 \u043f\u0443\u0442\u0438 \u043d\u0435\u0442 Temp \u2014 \u043d\u0435\u0442&#187;    if real.rstrip(&#171;\\\\\/&#187;).lower() == os.path.realpath(            os.path.expanduser(&#171;~&#187;)).rstrip(&#171;\\\\\/&#187;).lower():        return &#171;\u0434\u043e\u043c\u0430\u0448\u043d\u044f\u044f \u043f\u0430\u043f\u043a\u0430 \u2014 \u043d\u0435\u0442&#187;    return None\u0410 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043f\u0440\u0438 \u043e\u0431\u0445\u043e\u0434\u0435 \u043b\u044e\u0431\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 (junction \u043d\u0430 \u0432\u0438\u043d\u0434\u0435 \u0432\u0438\u0434\u043d\u043e \u043f\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0443 FILE_ATTRIBUTE_REPARSE_POINT) \u0443\u0434\u0430\u043b\u044f\u044e \u043a\u0430\u043a \u0441\u0441\u044b\u043b\u043a\u0443, \u043d\u043e \u0432\u043d\u0443\u0442\u0440\u044c \u043f\u043e \u043d\u0435\u0439 \u043d\u0435 \u0437\u0430\u0445\u043e\u0436\u0443. \u0418, \u0447\u0438\u0441\u0442\u043e \u0434\u043b\u044f \u0441\u043f\u043e\u043a\u043e\u0439\u0441\u0442\u0432\u0438\u044f, \u043f\u0435\u0440\u0435\u0434 \u0441\u043f\u0443\u0441\u043a\u043e\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0435\u0449\u0451 \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e \u0447\u0435\u0440\u0435\u0437 lstat, \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u0441\u0451 \u0435\u0449\u0451 \u043f\u0430\u043f\u043a\u0430, \u0430 \u043d\u0435 \u043f\u043e\u0434\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0439 \u0437\u0430 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0441\u0438\u043c\u043b\u0438\u043d\u043a (\u0442\u0430 \u0441\u0430\u043c\u0430\u044f \u0433\u043e\u043d\u043a\u0430 TOCTOU). \u0420\u0435\u0430\u043b\u044c\u043d\u043e \u044d\u0442\u043e \u043a\u0442\u043e-\u0442\u043e \u043f\u0440\u043e\u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0438\u0440\u0443\u0435\u0442 \u0432\u0440\u044f\u0434 \u043b\u0438, \u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432 \u0442\u0440\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u2014 \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435\u0442.if is_dir:    st2 = os.lstat(entry.path)          # \u0441\u0432\u0435\u0436\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0435\u0440\u0435\u0434 \u0441\u043f\u0443\u0441\u043a\u043e\u043c    if not stat.S_ISDIR(st2.st_mode) or \\       st2.st_file_attributes &amp; stat.FILE_ATTRIBUTE_REPARSE_POINT:        continue    clean_dir(entry.path)\u041f\u0430\u0440\u0430 \u043f\u0440\u0438\u043a\u043e\u043b\u043e\u0432 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0445\u0440\u0430\u043d\u044e \u0432 JSON \u0440\u044f\u0434\u043e\u043c \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439. \u0418 \u0442\u0443\u0442 \u0434\u0432\u0430 \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u043d\u044f \u0441\u043b\u0435\u0433\u043a\u0430 \u0443\u0434\u0438\u0432\u0438\u043b\u0438.\u041f\u0435\u0440\u0432\u044b\u0439: \u0437\u0430\u0445\u043e\u0442\u0435\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0440\u044f\u0434\u043e\u043c \u0441 exe. \u041f\u0438\u0448\u0443 os.access(path, os.W_OK) \u2014 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u00ab\u043c\u043e\u0436\u043d\u043e\u00bb. \u0412\u0441\u0435\u0433\u0434\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u00ab\u043c\u043e\u0436\u043d\u043e\u00bb. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043d\u0430 \u0432\u0438\u043d\u0434\u0435 os.access \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u0442\u043e\u043b\u043a\u043e\u043c \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u0432 ACL \u0438 \u0434\u043b\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043f\u0430\u043f\u043a\u0438 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 True. \u0422\u043e \u0435\u0441\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u0430\u0432 \u043e\u043d \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u0435\u043d. \u041d\u0443 \u043b\u0430\u0434\u043d\u043e, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e \u0447\u0435\u0441\u0442\u043d\u043e \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0431\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u0438\u043a:def _probe_writable(d):    probe = d \/ f&#187;.probe_{os.getpid()}.tmp&#187;    try:        probe.write_text(&#171;1&#187;); probe.unlink()        return True    except OSError:        return False\u0412\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435. \u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u043a\u043e\u043d\u0444\u0438\u0433 \u043f\u043e\u0431\u0438\u043b\u0441\u044f \u0438\u043b\u0438 \u0435\u0433\u043e \u043d\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0437\u0430\u043b\u043e\u0447\u0438\u043b \u0430\u043d\u0442\u0438\u0432\u0438\u0440\u0443\u0441? \u041b\u0435\u0433\u043a\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0434\u0443\u043c\u0430\u0435\u0442 \u00ab\u043d\u0435 \u0441\u043c\u043e\u0433 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u2014 \u0432\u043e\u0437\u044c\u043c\u0443 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435\u00bb \u0438 \u0441\u043d\u0435\u0441\u0451\u0442 \u0440\u043e\u0432\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043f\u043e\u043c\u0435\u0442\u0438\u043b \u00ab\u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0442\u044c\u00bb. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e \u0442\u0440\u0438 \u0441\u043b\u0443\u0447\u0430\u044f: \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b, \u0444\u0430\u0439\u043b\u0430 \u043d\u0435\u0442 (\u0431\u0435\u0440\u0443 \u0434\u0435\u0444\u043e\u043b\u0442), \u0444\u0430\u0439\u043b \u0435\u0441\u0442\u044c \u043d\u043e \u043d\u0435 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0447\u0438\u0449\u0443 \u0432\u043e\u043e\u0431\u0449\u0435:patterns = get_excludes()if patterns is None:            # \u0444\u0430\u0439\u043b \u0435\u0441\u0442\u044c, \u043d\u043e \u043d\u0435 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f    return {&#171;error&#187;: &#171;\u043a\u043e\u043d\u0444\u0438\u0433 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u2014 \u043e\u0447\u0438\u0441\u0442\u043a\u0443 \u043e\u0442\u043c\u0435\u043d\u044f\u044e&#187;}\u041b\u0443\u0447\u0448\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u043e\u043a, \u0447\u0435\u043c \u0441\u0442\u0435\u0440\u0435\u0442\u044c \u043d\u0435 \u0442\u043e. \u0412\u0441\u0451 \u0442\u043e \u0436\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0431\u043e\u043a\u0443.\u0410 \u0432\u043e\u0442 \u044d\u0442\u043e \u2014 \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435: \u0447\u0438\u0441\u0442\u0438\u043c \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0431\u0435\u0437 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438\u0420\u0430\u0434\u0438 \u044d\u0442\u043e\u0433\u043e, \u043f\u043e \u0441\u0443\u0442\u0438, \u0438 \u0437\u0430\u0442\u0435\u0432\u0430\u043b\u043e\u0441\u044c \u00ab\u0432\u043a\u043b\u044e\u0447\u0438\u043b \u0438 \u0437\u0430\u0431\u044b\u043b\u00bb.\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443, \u2014 \u0441\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u0442\u0440\u0435\u0439 \u0438 \u043a\u0440\u0443\u0442\u0438\u0442\u044c \u0442\u0430\u0439\u043c\u0435\u0440. \u041d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0440\u0430\u0434\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0440\u0430\u0437 \u0432 \u043d\u0435\u0434\u0435\u043b\u044e \u2014 \u044d\u0442\u043e \u043a\u0430\u043a \u043f\u043e\u0441\u0430\u0434\u0438\u0442\u044c \u043e\u0445\u0440\u0430\u043d\u043d\u0438\u043a\u0430 \u0443 \u043c\u0443\u0441\u043e\u0440\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0440\u0430\u0437 \u0432 \u0441\u0435\u043c\u044c \u0434\u043d\u0435\u0439 \u0432\u044b\u043d\u043e\u0441\u0438\u043b \u043f\u0430\u043a\u0435\u0442. \u041d\u0435 \u0445\u043e\u0447\u0443.\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u044f \u043e\u0442\u0434\u0430\u043b \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0430 \u043f\u0440\u043e\u0433\u0443 \u0441\u0434\u0435\u043b\u0430\u043b \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u043e\u0439. \u0414\u0432\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430, \u043e\u0431\u0430 \u0437\u043e\u0432\u0443\u0442 \u0435\u0451 \u0441 \u0444\u043b\u0430\u0433\u043e\u043c &#8212;clean-if-due. \u0417\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 \u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0435, \u0440\u0430\u0437 \u0432 \u0434\u0435\u043d\u044c:schtasks \/Create \/F \/TN TempCleanerAuto \/SC DAILY \/ST 12:00 ^         \/TR &#171;TempCleaner.exe &#8212;clean-if-due&#187;\u0418 \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0432 HKCU\\&#8230;\\Run \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u0435\u0441\u043b\u0438 \u0432 \u043f\u043e\u043b\u0434\u0435\u043d\u044c \u043a\u043e\u043c\u043f \u0431\u044b\u043b \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d.\u0410 \u0432\u0435\u0441\u044c \u0441\u043c\u044b\u0441\u043b \u0444\u043b\u0430\u0433\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0430 \u0441\u0430\u043c\u0430 \u0441\u043c\u043e\u0442\u0440\u0438\u0442, \u043f\u043e\u0440\u0430 \u043b\u0438, \u0438 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u043e\u0441\u043b\u0435 \u0441\u0435\u0431\u044f \u043d\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f:if &#171;&#8212;clean-if-due&#187; in sys.argv:    cfg = read_cfg()    days = cfg.get(&#171;schedule_days&#187;, 0)    last = cfg.get(&#171;last_run&#187;, 0)    if days and time.time() &#8212; last &gt;= days * 86400 &#8212; 3600:        run_clean()    sys.exit(0)     # \u0440\u0430\u043d\u043e \u2014 \u0432\u044b\u0448\u043b\u0438, \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0443\u0441\u0442\u043e\u0418 \u0442\u0443\u0442 \u0432\u044b\u043b\u0435\u0437 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u2014 \u043d\u0435 \u043f\u0440\u043e \u043a\u043e\u0434, \u043f\u0440\u043e \u043b\u044e\u0434\u0435\u0439. \u0414\u0430\u043b \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u043c\u0443 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c, \u043e\u043d \u0447\u0435\u0440\u0435\u0437 \u0434\u0435\u043d\u044c \u043f\u0438\u0448\u0435\u0442: \u00ab\u0441\u043b\u0443\u0448\u0430\u0439, \u0430 \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u043e\u043e\u0431\u0449\u0435? \u044f \u0435\u0433\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u0445 \u043d\u0435 \u0432\u0438\u0436\u0443\u00bb. \u0418 \u043e\u043d \u043f\u0440\u0430\u0432 \u2014 \u043d\u0435 \u0432\u0438\u0434\u0438\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0435\u0447\u0435\u0433\u043e, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442-\u0442\u043e \u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a.\u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u043e\u0435 \u0432\u0438\u0434\u0438\u043c\u044b\u043c: \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u0436\u0434\u0430\u044f \u0442\u0438\u0445\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442\u0441\u044f, \u0438 \u0432\u043d\u0438\u0437\u0443 \u043e\u043a\u043d\u0430 \u0432\u0438\u0441\u0438\u0442 \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0442\u0438\u043f\u0430 \u00ab\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0430\u0432\u0442\u043e\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430: \u0441\u0435\u0433\u043e\u0434\u043d\u044f, 08:44 \u2014 \u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0431\u044b\u043b\u043e \u0435\u0449\u0451 \u0440\u0430\u043d\u043e\u00bb. \u0421\u0432\u0435\u0436\u0430\u044f \u0434\u0430\u0442\u0430 \u2014 \u0438 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0441\u043f\u043e\u043a\u043e\u0435\u043d. \u0424\u0438\u0447\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e, \u0430 \u0434\u043b\u044f \u0434\u043e\u0432\u0435\u0440\u0438\u044f \u2014 \u0432\u0441\u0451.\u0421\u043e\u0431\u0440\u0430\u0442\u044c \u0438 \u043e\u0442\u0434\u0430\u0442\u044c\u0421\u043a\u0438\u0434\u044b\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c python temp_cleaner.pyw \u2014 \u043d\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043d\u0443\u0436\u0435\u043d \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a.exe \u0441\u043e\u0431\u0438\u0440\u0430\u044e PyInstaller\u2019\u043e\u043c (\u0440\u0435\u0436\u0438\u043c onedir, \u0431\u0435\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438), \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0442\u043e\u0440 \u2014 \u043d\u0430 NSIS. \u0421\u0442\u0430\u0432\u043b\u044e \u0432 \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0431\u0435\u0437 \u043f\u0440\u0430\u0432 \u0430\u0434\u043c\u0438\u043d\u0430 \u2014 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u043b\u0435\u0437\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u0432\u043e\u0439 Temp, \u0434\u0451\u0440\u0433\u0430\u0442\u044c \u0440\u0430\u0434\u0438 \u044d\u0442\u043e\u0433\u043e UAC \u043a\u0430\u043a-\u0442\u043e \u043d\u0435\u043f\u0440\u0438\u043b\u0438\u0447\u043d\u043e. \u0414\u0435\u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0443\u0431\u0438\u0440\u0430\u0435\u0442 \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430, \u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0438\u0437 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.\u041a\u0441\u0442\u0430\u0442\u0438, PyInstaller \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 Windows-exe \u043f\u043e\u0434 Wine \u043d\u0430 Linux \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u0438\u043d\u0434\u0430 \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0430\u0441\u044c. \u041f\u043e\u0434\u043f\u0438\u0441\u0438, \u043f\u0440\u0430\u0432\u0434\u0430, \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043b\u044e\u0434\u0438 \u0441\u043b\u043e\u0432\u044f\u0442 SmartScreen \u0441 \u00ab\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0438\u0437\u0434\u0430\u0442\u0435\u043b\u044c\u00bb; \u044d\u0442\u043e \u044f \u0447\u0435\u0441\u0442\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0432 README.\u0418\u0442\u043e\u0433\u043e\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0432 \u044d\u0442\u043e\u0439 \u043c\u0435\u043b\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u043a\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435 \u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432, \u0430 \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0435\u0433\u043e: \u0433\u0434\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u043d\u0435 \u0432\u044b\u0439\u0442\u0438 \u0437\u0430 \u043f\u0430\u043f\u043a\u0443, \u043a\u0430\u043a \u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f, \u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0431\u0438\u043b\u0438\u0441\u044c, \u0438 \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u043e\u043d\u043e\u0432\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u043d\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043b\u0438\u0448\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e, \u043d\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043d\u0430\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u043f\u0443\u043d\u043a\u0442\u043e\u043c \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u043e.\u0415\u0441\u043b\u0438 \u0447\u0442\u043e \u0438 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u043f\u043e\u0441\u0442\u0430 \u2014 \u0442\u043e \u043c\u044b\u0441\u043b\u044c, \u0447\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u0438\u0440\u0430\u0435\u0442, \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u043c \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c. \u041a\u043e\u043f\u0435\u0439\u043a\u0438 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 \u0440\u0430\u0441\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c.\u041a\u043e\u0434 \u043e\u0442\u043a\u0440\u044b\u0442 (MIT), \u0441\u0431\u043e\u0440\u043a\u0430 \u2014 \u0432 \u0440\u0435\u043b\u0438\u0437\u0430\u0445: GitHub. \u041d\u0430\u0439\u0434\u0451\u0448\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439, \u0433\u0434\u0435 \u043e\u043d\u043e \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u043c\u0438\u043c\u043e \u043f\u0440\u0430\u0432\u0438\u043b \u2014 \u043a\u0438\u0434\u0430\u0439 issue.\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 https:\/\/habr.com\/ru\/articles\/1080632\/<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-494159","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/494159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=494159"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/494159\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=494159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=494159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=494159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}