2 @perl %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
5 # Convert all the files in the current directory from unix to MS-DOS
6 # line ending conventions.
8 # By Diomidis Spinellis
10 open(FILES, 'find . -print |');
11 while ($file = <FILES>) {
15 print STDERR "Skipping binary file $file\n";
18 ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime,
19 $blksize, $blocks) = stat($file);
25 close(OFILE) || die "close xl$$: $!\n";
26 close(IFILE) || die "close $file: $!\n";
27 unlink($file) || die "unlink $file: $!\n";
28 rename("xl$$", $file) || die "rename(xl$$, $file): $!\n";
29 chmod($mode, $file) || die "chmod($mode, $file: $!\n";
30 utime($atime, $mtime, $file) || die "utime($atime, $mtime, $file): $!\n";