diff options
Diffstat (limited to 'msdos/eg')
-rw-r--r-- | msdos/eg/crlf.bat | 32 | ||||
-rw-r--r-- | msdos/eg/drives.bat | 41 | ||||
-rw-r--r-- | msdos/eg/lf.bat | 33 |
3 files changed, 0 insertions, 106 deletions
diff --git a/msdos/eg/crlf.bat b/msdos/eg/crlf.bat deleted file mode 100644 index 24d73661b9..0000000000 --- a/msdos/eg/crlf.bat +++ /dev/null @@ -1,32 +0,0 @@ -@REM=(" -@perl %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 -@end ") if 0 ; - -# Convert all the files in the current directory from unix to MS-DOS -# line ending conventions. -# -# By Diomidis Spinellis -# -open(FILES, 'find . -print |'); -while ($file = <FILES>) { - $file =^ s/[\n\r]//; - if (-f $file) { - if (-B $file) { - print STDERR "Skipping binary file $file\n"; - next; - } - ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, - $blksize, $blocks) = stat($file); - open(IFILE, "$file"); - open(OFILE, ">xl$$"); - while (<IFILE>) { - print OFILE; - } - close(OFILE) || die "close xl$$: $!\n"; - close(IFILE) || die "close $file: $!\n"; - unlink($file) || die "unlink $file: $!\n"; - rename("xl$$", $file) || die "rename(xl$$, $file): $!\n"; - chmod($mode, $file) || die "chmod($mode, $file: $!\n"; - utime($atime, $mtime, $file) || die "utime($atime, $mtime, $file): $!\n"; - } -} diff --git a/msdos/eg/drives.bat b/msdos/eg/drives.bat deleted file mode 100644 index c68306ed8d..0000000000 --- a/msdos/eg/drives.bat +++ /dev/null @@ -1,41 +0,0 @@ -@REM=(" -@perl %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 -@end ") if 0 ; - -# -# Test the ioctl function for MS-DOS. Provide a list of drives and their -# characteristics. -# -# By Diomidis Spinellis. -# - -@fdnum = ("STDIN", "STDOUT", "STDERR"); -$maxdrives = 15; -for ($i = 3; $i < $maxdrives; $i++) { - open("FD$i", "nul"); - @fdnum[$i - 1] = "FD$i"; -} -@mediatype = ( - "320/360 k floppy drive", - "1.2M floppy", - "720K floppy", - "8'' single density floppy", - "8'' double density floppy", - "fixed disk", - "tape drive", - "1.44M floppy", - "other" -); -print "The system has the following drives:\n"; -for ($i = 1; $i < $maxdrives; $i++) { - if ($ret = ioctl(@fdnum[$i], 8, 0)) { - $type = ($ret == 0) ? "removable" : "fixed"; - $ret = ioctl(@fdnum[$i], 9, 0); - $location = ($ret & 0x800) ? "local" : "remote"; - ioctl(@fdnum[$i], 0x860d, $param); - @par = unpack("CCSSSC31S", $param); - $lock = (@par[2] & 2) ? "supporting door lock" : "not supporting door lock"; - printf "%c:$type $location @mediatype[@par[1]] @par[3] cylinders @par[6] - sectors/track $lock\n", ord('A') + $i - 1; - } -} diff --git a/msdos/eg/lf.bat b/msdos/eg/lf.bat deleted file mode 100644 index 9c13eef840..0000000000 --- a/msdos/eg/lf.bat +++ /dev/null @@ -1,33 +0,0 @@ -@REM=(" -@perl %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 -@end ") if 0 ; - -# Convert all the files in the current directory from MS-DOS to unix -# line ending conventions. -# -# By Diomidis Spinellis -# -open(FILES, 'find . -print |'); -while ($file = <FILES>) { - $file =^ s/[\n\r]//; - if (-f $file) { - if (-B $file) { - print STDERR "Skipping binary file $file\n"; - next; - } - ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, - $blksize, $blocks) = stat($file); - open(IFILE, "$file"); - open(OFILE, ">xl$$"); - binmode OFILE || die "binmode xl$$: $!\n"; - while (<IFILE>) { - print OFILE; - } - close(OFILE) || die "close xl$$: $!\n"; - close(IFILE) || die "close $file: $!\n"; - unlink($file) || die "unlink $file: $!\n"; - rename("xl$$", $file) || die "rename(xl$$, $file): $!\n"; - chmod($mode, $file) || die "chmod($mode, $file: $!\n"; - utime($atime, $mtime, $file) || die "utime($atime, $mtime, $file): $!\n"; - } -} |