$path = {
"D:/ftp/new3" => "new3",
"D:/ftp/new4" => "new4",
"G:/6rnew3" => "6rnew3",
"G:/6rother" => "6rother",
"//ZH99998-NP/6rdown" => "6rdown",
"//ZH99998-NP/pic" => "6rpic",
}
def get_info(path)
Dir.foreach(path) do |f|
next if f == "." or f == ".."
#f = Iconv.conv("utf-8", "gbk", f)
#f = Iconv.utf8_to_gb2312(f)
fp = (path+"/"+f)
next get_info(fp) if File.directory?(fp)
@name << f
@size << (File.size(fp) rescue nil)
@time << (File.mtime(fp) rescue nil)
@path << path[$ps,path.size-$ps]
@user << $u
#p @path.last,$u
end
end
@name,@size,@time,@path,@user = [[],[],[],[],[]]
$path.each_pair{|path,user|$ps=path.size+1;$u=user;get_info(path)}
open("result.rvdata","w"){|f|
Marshal.dump({"name"=>@name,"size"=>@size,"time"=>@time,"path"=>@path,"user"=>@user}, f)}
p "完成"
exit