require "chise/qp"
module CHISE
- module TableAccessModule
- def to_hash
- h = {}
- each {|k, v| h[k] = v }
- h
- end
-
- def dump
- txt = @name.path.escape.escape_win_filename.to_s+".txt"
- t = @ds.location+@category+@keyvalue+txt
- t.open("wb"){|out|
- to_hash.sort.each {|k, v|
- out.printf("%s\t%s\n", k, v)
- }
- }
- end
- end
-
class DataBaseManagement
def dump_all
cd = ChiseDB.instance
- cd.each_feature {|f|
+ cd.each_feature_name {|f|
ft = cd.get_feature(f)
ft.dump
ft.close
end
def move_obsolete_files
- fpath = Config.instance.db_dir.path+"system-char-id"
- fpath.chdir {
+ #fpath = Config.instance.db_dir.path+"system-char-id"
+ fpath = Config.instance.db_dir.path+"character/feature"
+ #fpath.chdir {
+ Dir.chdir(fpath.to_s) {
opath = "obsolete".path
opath.mkdir unless opath.directory?
next if /\A#/ =~ attr
f = attr.path.escape.escape_win_filename
FileUtils.mv(f.to_s, opath.to_s, @opt) if f.exist?
- f = f.to_s+".txt"
+ f = (f.to_s+".txt").path
FileUtils.mv(f.to_s, opath.to_s, @opt) if f.exist?
}
}