Inital commit

This commit is contained in:
Tilman
2011-10-26 09:10:47 +02:00
commit aff0bbda5e
3 changed files with 66 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>GroovyScripts</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
+41
View File
@@ -0,0 +1,41 @@
def srcDir = "/home/tilman/hidrive/users/tilman/Privat"
def srcDirLength = srcDir.size()
def destDir = "/media/Black/hidrive/users/tilman/Privat"
def delClos
def problemOutput = new File('differentSizes.txt')
problemOutput.append("Divergent sizes were detected for the following files:\n\n")
def problemCount = 0
def modifiedOutput = new File('changedDates.txt')
modifiedOutput.append("Changed dates for the following files:\n\n")
def modifiedCount = 0
delClos = { it.eachDir( delClos );
it.eachFile {
def path = it.canonicalPath
def syncFile = new File(destDir + path[srcDirLength..path.size()-1])
if (it.size() != syncFile.size()) {
problemOutput.append(syncFile.toString() + " (${it.size()}/${syncFile.size()})\n")
problemCount++
//println "Filesize (${it.size()}/${syncFile.size()}): ${path}"
}
//if ((syncFile.size() > 0) && (it.lastModified() != syncFile.lastModified())) {} // Ordner und nicht vorhandene Dateien überspringen?
if ((it.size() == syncFile.size()) && (it.lastModified() != syncFile.lastModified())) {
//syncFile.setLastModified(it.lastModified())
modifiedOutput.append(syncFile.toString() + " (${it.lastModified()}/${syncFile.lastModified()})\n")
modifiedCount++
//println "Time (${it.lastModified()}/${syncFile.lastModified()}): ${path}"
}
}
}
delClos( new File(srcDir) )
println "Detected divergent size for ${problemCount} files."
println "Modified dates for ${modifiedCount} files."
return null