| 1 |
|
| 2 |
ルなどの権限チェック |
| 3 |
|
| 4 |
require 'fileutils' |
| 5 |
require 'environment' |
| 6 |
|
| 7 |
begin |
| 8 |
directories = [Environment::CONFROOT, Environment::LOGDIR, Environment::TMPDIR, Environment::SETTINGDIR] |
| 9 |
directories.each{ |dir| |
| 10 |
FileUtils.mkdir_p(File.expand_path(dir)) } |
| 11 |
Dir.glob(directories.map{ |path| File.join(File.expand_path(path), '**', '*') }){ |file| |
| 12 |
unless FileTest.writable_real?(file) |
| 13 |
chi_fatal_alert("#{file} に書き込み権限を与えてください") end |
| 14 |
unless FileTest.readable_real?(file) |
| 15 |
chi_fatal_alert("#{file} に読み込み権限を与えてください") end |
| 16 |
} |
| 17 |
end |