On Mon, 7 Nov 2022 22:06:46 +0000
Derek Pagel wrote:
> I've printed the script below for reference:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> use strict;
> use Cwd;
> 
> my $TESTDIR = getcwd() . "\\test<file://test>";
> my $MKDIRCMD = "mkdir test";
> my $TOUCHCMD = 'touch test.txt';
> my $CPCMD = 'cp test.txt test2.txt';
> my $MVCMD = "mv test.txt " . $TESTDIR . "\\test.txt<file://test.txt>";
> my $WHICHCMD = 'which explorer.exe';
> my $RMCMD = "rm " . $TESTDIR . "\\test.txt 
> test2.txt<file://test.txt%20test2.txt>";
> my $count = 0;
> my $fh;
> my $LOG = open $fh, '>', 'cygwinTest.log';
> 
> if ( ! -e $TESTDIR ) {
>                 runCMD($MKDIRCMD, 0);
> }
> 
> while ($count < 10000) {
>                 print "Loop $count:\n";
>                 runCMD($TOUCHCMD, $count);
>                 runCMD($CPCMD, $count);
>                 runCMD($MVCMD, $count);
>                 runCMD($WHICHCMD, $count);
>                 runCMD($RMCMD, $count);
>                 $count++;
> }
> 
> sub runCMD {
>                 my $CMD = $_[0];
>                 my $COUNT = $_[1];
>                 my $retCode;
>                 my $startTime;
>                 my $endTime;
>                 my $totalTime;
> 
>                 $startTime = time();
>                 $CMD = "C:\\Windows\\system32\\cmd.exe /c $CMD";
>                 $retCode = system($CMD);
>                 $endTime = time();
>                 $totalTime = $endTime - $startTime;
>                 if ($totalTime > 1 ) {
>                                 print $fh "Loop #$COUNT:\n";
>                                 if ($retCode == 0) {
>                                                 print $fh "It took $totalTime 
> seconds to run [$CMD]\n";
>                                 } else {
>                                                 print $fh "It took $totalTime 
> seconds to unsuccesfully run [$CMD]\n";
>                                 }
>                 }
> }
> 
> close $fh;
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Which script language do you use for this script?
It looks like perl script, however, cygwin perl
cannot run this script.

-- 
Takashi Yano <takashi.y...@nifty.ne.jp>

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to