2008/08/07 11:00:16
47
14
4 builder.japan.zdnet.com [
この元コンテンツへ ]
require 'parsedate' require 'fileutils' require 'find' require 'rubygems' require 'extexif' # フォルダ指定 src = "/mnt/card/DCIM/100NECDT/" dst = "/var/image/" # ファイルリスト作成 list = [] Find.find(File.expand_path(src)) { |path| if /.*(jpg|JPG|jpeg|JPG)\z/ =~ path list << path end } # 振り分け list.sort.each { |path| image = ExtExif.new(path) foldername = image["MetadataDate"][0,10].split(/:/).join folderpath = dst + foldername Dir.mkdir(folderpath) unless File.exist?(folderpat...
[
← 前の画面 ]
【 PR 】 SEO のための CSS トピックスまとめ [ 無料 ] [
ニコニコ風 ] [
関連記事 ] [
Feeling Lucky ]