Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use ARGV[0] if set

  • Loading branch information...
commit 8a506cfe59194c351aff7df38644136c3de7761c 1 parent f498239
@kazuho authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 blockdiff_dump
View
7 blockdiff_dump
@@ -8,7 +8,7 @@ use Digest::MD5 qw(md5);
use Errno;
# file descriptors:
-# 0 < data file
+# 0 < data file (or uses $ARGV[0] if exists)
# 1 > patch data
# 5 < old digest (optional)
# 6 > new digest
@@ -33,6 +33,11 @@ sub readall {
my $blocksize = $ENV{BLOCKSIZE} || 16384;
+if (@ARGV == 1) {
+ open STDIN, '<', $ARGV[0]
+ or die "failed to open:$ARGV[0]:$!";
+}
+
# open files
open my $new_digest_fp, '>&=', 6
or die "cloud not open digest data output (fd:6):$!";
Please sign in to comment.
Something went wrong with that request. Please try again.