::/** XYplorer: Generate folders checksums Creates a MD5 checksum file for selected folders. Just select some folders in any panel and run. It will scan all subfiles/subfolders within and generate a md5 checksum file in each folder. The checksum file will be like [folder-name].md5 . It will ignore the folder if there is already a checksum in it. The checksum also ignores any existing .md5 or .sfv files. At the end, it shows the execution log. @author rdoi @created feb/2014 */ $log="ChecksumsInFolders.xys: RDoi folders MD5 checksum creator-------------------------------"; foreach($folder, "", "") { $log=$log."Processing ".$folder."..."; if (exists($folder) == 1) { $log=$log."-SKIPPED: Not a folder."; } else { $csfile=$folder."\".regexreplace($folder,"^.*\\", "").".md5"; if (exists($csfile) == 1) { $log=$log."-IGNORED: Checksum exists. (".$csfile.")"; } else { $checksum="; MD5 checksum generated by RDOI XYplorer script; ".$folder.""; foreach($file, folderreport("filesrel", "r", $folder, "r", , "|"), "|") { $filepath=$folder."\".$file; if ( regexmatches($filepath,"(\.md5|\.sfv)$") == "") { $hash=hash("md5",$filepath,3); $checksum=$checksum.$hash." *".$file.""; } else { $log=$log."-IGNORED: Checksum file. (".$filepath.")"; } } writefile($csfile,$checksum); $log=$log."+CREATED. (".$csfile.")"; } } $log=$log.""; } text $log;