{"id":106,"date":"2017-07-08T12:09:41","date_gmt":"2017-07-08T10:09:41","guid":{"rendered":"http:\/\/developer.ps\/?p=106"},"modified":"2017-07-18T21:13:20","modified_gmt":"2017-07-18T19:13:20","slug":"python-script-to-set-file-dates","status":"publish","type":"post","link":"https:\/\/developer.ps\/index.php\/2017\/07\/08\/python-script-to-set-file-dates\/","title":{"rendered":"Python Script to set file dates"},"content":{"rendered":"#!\/usr\/bin\/python\r\n# -*- coding: utf-8 -*-\r\n\r\nimport sqlite3 as lite\r\nimport os, csv, sys, subprocess, hashlib, time\r\nfrom datetime import timedelta, datetime, tzinfo\r\nimport platform\r\n\r\ncon = lite.connect('files.db')\r\ncon.text_factory = str\r\nwith con:\r\n    for directory, subdirectories, filenames in os.walk('.'):\r\n        print(directory);\r\n        cur = con.cursor()    \r\n        cur.execute(\"SELECT * FROM data where path=:directory COLLATE NOCASE\", {\"directory\":directory})\r\n        con.commit()\r\n <a href=\"https:\/\/developer.ps\/index.php\/2017\/07\/08\/python-script-to-set-file-dates\/\" class=\"more-link\">Read more [...]<\/a>","protected":false},"excerpt":{"rendered":"<p>#!\/usr\/bin\/python # -*- coding: utf-8 -*- import sqlite3 as lite import os, csv, sys, subprocess, hashlib, time from datetime import timedelta, datetime, tzinfo import platform con = lite.connect(&#8216;files.db&#8217;) con.text_factory = str with con: for directory, subdirectories, filenames in os.walk(&#8216;.&#8217;): print(directory); cur = con.cursor() cur.execute(&#8220;SELECT * FROM data where path=:directory COLLATE NOCASE&#8221;, {&#8220;directory&#8221;:directory}) con.commit() Read more [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[11],"tags":[],"class_list":["post-106","post","type-post","status-publish","format-standard","hentry","category-python"],"wps_subtitle":"from Lite SQL database","_links":{"self":[{"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/posts\/106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/comments?post=106"}],"version-history":[{"count":1,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/posts\/106\/revisions"}],"predecessor-version":[{"id":107,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/posts\/106\/revisions\/107"}],"wp:attachment":[{"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/media?parent=106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/categories?post=106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/tags?post=106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}