{"id":1343,"date":"2020-11-30T08:23:49","date_gmt":"2020-11-30T00:23:49","guid":{"rendered":"http:\/\/euhat.com\/wp\/?p=1343"},"modified":"2020-11-30T08:23:49","modified_gmt":"2020-11-30T00:23:49","slug":"windows%e5%b9%b3%e5%8f%b0%e4%b8%8b%e6%96%b0%e7%9a%84%e6%96%87%e4%bb%b6%e6%89%8d%e6%8b%b7%e8%b4%9d","status":"publish","type":"post","link":"http:\/\/euhat.com\/wp\/2020\/11\/30\/windows%e5%b9%b3%e5%8f%b0%e4%b8%8b%e6%96%b0%e7%9a%84%e6%96%87%e4%bb%b6%e6%89%8d%e6%8b%b7%e8%b4%9d\/","title":{"rendered":"Windows\u5e73\u53f0\u4e0b\u65b0\u7684\u6587\u4ef6\u624d\u62f7\u8d1d"},"content":{"rendered":"<p>Linux\u4e0b\u7684cp -u\u80fd\u5b9e\u73b0\u53ea\u5728\u6e90\u6587\u4ef6\u6bd4\u76ee\u6807\u6587\u4ef6\u65b0\u65f6\u624d\u62f7\u8d1d\uff0c\u4f46\u6b64\u547d\u4ee4\u5728MinGW\u4e0b\u4e0d\u597d\u4f7f\uff0c\u6211\u901a\u8fc7\u5728\u7f51\u4e0a\u67e5\u65b9\u6cd5\uff0c\u5199\u4e86\u4ee5\u4e0b\u540c\u6837\u529f\u80fd\u7684\u811a\u672c\uff1a<\/p>\n<pre lang=\"bash\" line=\"1\">\nclearBinary()\n{\n\tlocal destDir=$1\n\tlocal fileName=$2\n\tlocal ext=$3\n\n\trm \"${destDir}\/${fileName}.${ext}\" 1>\/dev\/null 2>&1\n\t\n\tfor ((j = 1; j <= 20; j++)); do\n\t\tif [ -f \"${destDir}\/${fileName}_$j.${ext}\" ] ; then\n\t\t\trm \"${destDir}\/${fileName}_$j.${ext}\"\n\t\tfi\n\tdone\n\t\t\n\tfor ((j = 1; j <= 20; j++)); do\n\t\tif [ -f \"${destDir}\/${fileName}.${ext}\" ] ; then\n\t\t\tmv \"${destDir}\/${fileName}.${ext}\" \"${destDir}\/${fileName}_$j.${ext}\"\n\t\tfi\n\tdone\n}\n\ncopyFile()\n{\n\tlocal srcDir=$1\n\tlocal destDir=$2\n\tlocal fileName=$3\n\tlocal ext=$4\n\t\n\tlocal srcPath=${srcDir}\/${fileName}.${ext}\n\tlocal destPath=${destDir}\/${fileName}.${ext}\n\t\n\tif [ ! -f \"${srcPath}\" ] ; then\n\t\treturn\n\tfi\n\t\t\n\tlocal timeFrom=`stat -c %Y \"${srcPath}\"`\n\tlocal timeTo=`stat -c %Y \"${destPath}\"`\n\tif [ \"$timeFrom\" = \"$timeTo\" -a \"x$forceReplace\" != \"xforce\" ]; then\n\t\treturn\n\tfi\n\t\n\tclearBinary \"${destDir}\" ${fileName} ${ext}\n\t\n\tcp \"${srcPath}\" \"${destPath}\"\n\t\n\tlocal timeFromStr=`date -d \"@$timeFrom\" \"+%Y-%m-%d %H:%M:%S\"`\n\ttouch -m -d \"$timeFromStr\" \"${destPath}\"\n\t\t\n\techo \"[${srcPath}]->[${destPath}] copied.\"\n}\n\ncopyFile \/e\/source \/c\/dest hello docx \n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u4e0b\u7684cp -u\u80fd\u5b9e\u73b0\u53ea\u5728\u6e90\u6587\u4ef6\u6bd4\u76ee\u6807\u6587\u4ef6\u65b0\u65f6\u624d\u62f7\u8d1d\uff0c\u4f46\u6b64\u547d\u4ee4\u5728MinGW\u4e0b\u4e0d\u597d\u4f7f\uff0c\u6211\u901a\u8fc7\u5728\u7f51\u4e0a\u67e5\u65b9\u6cd5\uff0c\u5199\u4e86\u4ee5\u4e0b\u540c\u6837\u529f\u80fd\u7684\u811a\u672c\uff1a clearBinary() { local destDir=$1 local fileName=$2 local ext=$3 rm \"${destDir}\/${fileName}.${ext}\" 1>\/dev\/null 2>&#038;1 for ((j = 1; j<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[418,440,495],"_links":{"self":[{"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/posts\/1343"}],"collection":[{"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/comments?post=1343"}],"version-history":[{"count":0,"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/posts\/1343\/revisions"}],"wp:attachment":[{"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/media?parent=1343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/categories?post=1343"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/tags?post=1343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}