Hi,
Can anyone make sense of this:
D:\math-mpfr\build58\cpan>type try.pl
use warnings;
if(system("rmdir /S /Q Math-MPFR-1.07\\t")) {die "Failure"}
D:\math-mpfr\build58\cpan>perl try.pl
rmdir: `/S': No such file or directory
rmdir: `/Q': No such file or directory
rmdir: `Math-MPFR-1.07\\t': Directory not empty
Failure at try.pl line 3.
D:\math-mpfr\build58\cpan>rmdir /S /Q Math-MPFR-1.07\t
D:\math-mpfr\build58\cpan>
Three things I do not understand:
1) I have run try.pl as part of an automated procedure on the same machine,
in the same shell, probably about 20 times in the past. Tonight is the first
time it has decided to behave in a manner other than I expected;
2) Why perl has suddenly decided that a backslash inside double quotes in a
system() command no longer represents an escape;
3) Why rmdir in the system command thinks that /S and /Q are folders, yet
understands them perfectly when run from the command line.
Two things have changed since I last ran this script:
1) I've switched from perl5.8.6 to perl5.8.7 - but that's not the problem,
because when I revert to 5.8.6 the same behaviour persists.
2) I've run Windows Update a coupla times.
I'm also open to suggestions on how I might successfully run 'rmdir /S /Q
Math-MPFR-1.07\t' as a system() command from perl. I tried the following
(both of which produced the same nonsensical result as appears above):
use warnings;
$command = 'rmdir /S /Q Math-MPFR-1.07\\t';
if(system($command)) {die "Failure"}
use warnings;
@command = ('rmdir', '/S', '/Q', 'Math-MPFR-1.07\\t');
if(system(@command)) {die "Failure"}
I'm on Windows2000.
Aaah ... I've just now found a solution. If I change 'rmdir' to 'rd' it
works fine - but I'll send this post anyway ... it might save someone else
some agony. And I'm still completely in the dark as regards what's going on
... any explanations gratefully received.
Btw, here's what 'rmdir /?' reveals for me:
D:\math-mpfr>rmdir /?
Removes (deletes) a directory.
RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path
/S Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
tree.
/Q Quiet mode, do not ask if ok to remove a directory tree with /S
Cheers,
Rob
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs