svnno****@sourc*****
svnno****@sourc*****
2008年 10月 16日 (木) 00:42:19 JST
Revision: 84 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=swfed&view=rev&rev=84 Author: yoya Date: 2008-10-16 00:42:19 +0900 (Thu, 16 Oct 2008) Log Message: ----------- 既にある swf,jpg,png ファイルを上書きしないように修正 (無駄なので) Modified Paths: -------------- trunk/www/swfdump.php trunk/www/swfimagelist.php -------------- next part -------------- Modified: trunk/www/swfdump.php =================================================================== --- trunk/www/swfdump.php 2008-10-15 15:35:34 UTC (rev 83) +++ trunk/www/swfdump.php 2008-10-15 15:42:19 UTC (rev 84) @@ -22,8 +22,9 @@ $tmp_name = sha1($swfdata, false); $id = substr($tmp_name, 0, 16); // XXX $tmp_filename = "$tmp_prefix$id.swf"; - if (! file_put_contents($tmp_filename, $swfdata)) { - echo 'ERROR: file_put_contents failed. zero size ?'."\n"; + if ((! is_readable($tmp_filename)) && + (! file_put_contents($tmp_filename, $swfdata))) { + fprintf(stderr, "swfdump.php: file_put_contents failed. zero size?\n"); unlink($tmp_filename); exit(0); } Modified: trunk/www/swfimagelist.php =================================================================== --- trunk/www/swfimagelist.php 2008-10-15 15:35:34 UTC (rev 83) +++ trunk/www/swfimagelist.php 2008-10-15 15:42:19 UTC (rev 84) @@ -34,7 +34,9 @@ } else { $image_data = $swf->getPNGData(intval($image_id)); } - file_put_contents($image_filename, $image_data); + if (! is_readable($image_filename)) { + file_put_contents($image_filename, $image_data); + } echo "<tr>\n"; echo "<td> $name($tag) </td> "; echo "<td> $image_id (ext=$ext)</td>\n";