Mercurial > mercurial > hgweb_iklist.hg.cgi
view prog/07.pl @ 1:13e80a745ef0 draft
beta2 release.
author | pyon <pyon@macmini> |
---|---|
date | Tue, 24 Aug 2021 21:30:47 +0900 |
parents | |
children | c0f76f8e67fa |
line wrap: on
line source
# ファイル分割 my $tmp = "pdf"; my $buf0; for my $file (glob "_data03/*") { open my $fi, '<', $file; binmode($fi); read($fi, $buf0, 4); open my $fo, '>', $tmp; binmode($fo); my $buf; while (read($fi, $buf, 1024)) { print {$fo} $buf; } close $fo; close $fi; my $fn = substr $file, 1; rename $tmp, $fn; } open my $f, '>', $tmp; binmode($f); print {$f} $buf0; close $fo;