2008/5/8 Steph Fox <steph@zend.com>:
If only I could send the sound of my shoulders slumping as yet another
post is ignored/filtered.
http://news.php.net/php.internals/37517I only asked why :)
As I said in the original post, if you have cygwin installed (as was
needed to build the PHP documentation in the bad old days before phd),
then rmdir.exe would be in your path).
Wouldn't having /cygwin/bin permanently in your PATH screw up native
executables throughout? Can you use MS rmdir on your system at all?
No. As in normal windows, shell commands take precedence over
programs/scripts, even with the same name. If I want to use a cygwin
program in preference to a windows one, then I will either delete or
rename the windows one. If I can't do that, then I will put the cygwin
version in a tools directory which is in the path before windows, et
al.
rmdir does not exist as an "executable" in windows/dos. It is part of
the shell (command.com/cmd.exe). There is no "program" (or script or
anything) called rmdir.anything.
Here is some steps I've taken to show the problem. If you don't have
cygwin in your path, then this isn't an issue. But I do and I use
cygwin tools all day. This patch removes the problem. For the last 20
years of software development, I've always used md/cd/rd rather than
mkdir/chdir/rmdir. In windows they are the same thing.
Find all rmdir.somethings in the path.
2008/05/09 11:11:07 C:\>whereis rmdir
Directory Found (Date and Size)
============= ===========================
D:\Cygwin\bin rmdir.EXE 2008-01-24 43,008
Let's see the builtin help for rmdir.
2008/05/09 11:11:22 C:\>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
Let's see cygwin's help for rmdir - notice no support for /s or /q.
2008/05/09 11:11:26 C:\>d:\cygwin\bin\rmdir --help
Usage: /usr/bin/rmdir [OPTION]... DIRECTORY...
Remove the DIRECTORY(ies), if they are empty.
--ignore-fail-on-non-empty
ignore each failure that is solely because a directory
is non-empty
-p, --parents Remove DIRECTORY and its ancestors. E.g., `rmdir -p a/b/c' is
similar to `rmdir a/b/c a/b a'.
-v, --verbose output a diagnostic for every directory processed
--help display this help and exit
--version output version information and exit
Report bugs to <bug-coreutils@gnu.org>.
Create a directory and remove it using /s.
2008/05/09 11:11:30 C:\>md bob
2008/05/09 11:11:34 C:\>rmdir /s bob
bob, Are you sure (Y/N)? y
Now repeat with cygwin's rmdir.exe
2008/05/09 11:11:41 C:\>md bob
2008/05/09 11:11:43 C:\>d:\cygwin\bin\rmdir.exe /s bob
/usr/bin/rmdir: failed to remove `/s': No such file or directory
If I run nmake clean-all inside my vcvars32.bat environment, I get the
cygwin error.
If I run filemon it shows nmake hunting through my path looking for
rmdir.xxx where xxx is one of my extensions in PATHEXT
(PATHEXT=.COM;.EXE;.BAT;.CMD;.PHP;.PYC;.PY;;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.RB;.RBW).
Effectively nmake is not respecting the shell to run internal commands.
As you can see (hopefully), rmdir is a SHELL command, even if an
executable exists with the same name and that executable is in the
path.
The issue is that nmake doesn't respect the shell command until after
it has done the search via the path.
Even with cygwin in the path, I have no problem running windows shell
scripts. I even sometimes use cygwin executable as they do things
differently or provide facilities windows don't have (tiff tools for
example).
Aren't you running vcvars32.bat before you hit nmake? Or do you have MS
headers permanently in your PATH too?
Yes I am. But that only adds a few env vars. It doesn't remove cygwin
from the path (and why should it).
This is an edited diff of my environments (normal vs vccars32.bat)
--- out.txt 2008-05-09 11:03:16.616418300 +0100
+++ in.txt 2008-05-09 11:03:22.397668300 +0100
@@ -5,14 +5,21 @@
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=RICHARDQUADLING
ComSpec=C:\WINDOWS\system32\cmd.exe
+DevEnvDir=C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
DIRCMD=/A /C /4 /OGEN /N,
FP_NO_HOST_CHECK=NO
+Framework35Version=v3.5
+FrameworkDir=C:\WINDOWS\Microsoft.NET\Framework
+FrameworkVersion=v2.0.50727
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\RichardQ
+INCLUDE=C:\Program Files\Microsoft Visual Studio
9.0\VC\INCLUDE;C:\Program Files\Microsoft SDKs\Windows\v6.1\include;
+LIB=C:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;C:\Program
Files\Microsoft SDKs\Windows\v6.1\lib;
+LIBPATH=C:\WINDOWS\Microsoft.NET\Framework\v3.5;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program
Files\Microsoft Visual Studio 9.0\VC\LIB;
LOGONSERVER=\\xxxxxxxx
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
-Path=[SNIPPED]
+Path=C:\Work\php_build\bin;C:\Program Files\Microsoft Visual Studio
9.0\Common7\IDE;C:\Program Files\Microsoft Visual Studio
9.0\VC\BIN;C:\Program Files\Microsoft Visual Studio
9.0\Common7\Tools;C:\WINDOWS\Microsoft.NET\Framework\v3.5;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program
Files\Microsoft Visual Studio 9.0\VC\VCPackages;C:\Program
Files\Microsoft SDKs\Windows\v6.1\bin;[SNIPPED]
PATHEXT=.COM;.EXE;.BAT;.CMD;.PHP;.PYC;.PY;;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.RB;.RBW
PATHEXTORIG=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PHP_PEAR_BIN_DIR=C:\PEAR
@@ -40,5 +47,8 @@
USERDOMAIN=xxxxxxxx
USERNAME=RichardQ
USERPROFILE=C:\Documents and Settings\RichardQ
+VCINSTALLDIR=C:\Program Files\Microsoft Visual Studio 9.0\VC
VS90COMNTOOLS=C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\
+VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 9.0
windir=C:\WINDOWS
+WindowsSdkDir=C:\Program Files\Microsoft SDKs\Windows\v6.1\
- Steph
--
-----
Richard Quadling
Zend Certified Engineer :
http://zend.com/zce.php?c=ZEND002498&r=213474731"Standing on the shoulders of some very clever giants!"