Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/use/bin/ruby
- # coding: utf-8
- require 'fileutils'
- require 'pathname'
- abort unless ARGV.size == 1
- base_dir = Pathname ARGV.shift
- base_dir.children.each do |f|
- dir = Pathname "#{base_dir}/#{f.mtime.strftime '%Y年%m月%d日'}"
- FileUtils::Verbose.mkdir dir unless dir.directory?
- FileUtils::Verbose.mv f, dir
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement