8 # Perl script 'copy' comment. On Windows the built in "copy" command also
9 # copies timestamps: this messes up Makefile dependencies.
15 foreach $arg (@ARGV) {
16 if ($arg eq "-stripcr")
21 $arg =~ s
|\\|/|g; # compensate for bug/feature
in cygwin
glob...
32 die "Need at least two filenames";
35 $dest = pop @filelist;
37 if ($fnum > 2 && ! -d
$dest)
39 die "Destination must be a directory";
47 $dfile =~ s
|^.*[/\\]([^/\\]*)$|$1|;
48 $dfile = "$dest/$dfile";
54 sysopen(IN
, $_, O_RDONLY
|O_BINARY
) || die "Can't Open $_";
55 sysopen(OUT
, $dfile, O_WRONLY
|O_CREAT
|O_TRUNC
|O_BINARY
)
56 || die "Can't Open $dfile";
57 while (sysread IN
, $buf, 10240)
63 syswrite(OUT
, $buf, length($buf));
67 print "Copying: $_ to $dfile\n";