Jump to content


Photo

exec ("dir") problem on WinXP


  • Please log in to reply
No replies to this topic

#1 cadams7407

cadams7407
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 07 September 2006 - 06:58 PM

PHP 4.3.11 on WinXP Pro 32bit

I am using
exec("dir pictures/$input /b/x",$pic);
and then counting the number of files in $pic. $input = a product id number; this id number corresponds to a directory inside htdocs/pictures. Example, the widget is product numer 4. Pictures of the widget are in htdocs/pictures/4  I need to count the number of files in /4 and this code is returning my else command. Not what I want.

Strangly, I found that if I change code to
exec("dir $input /b/x",$pic);
and move all the subdirectories of /pictures up one level to /htdocs (ie. widget pics are now htdocs/4) it frickin works ???

So, how is it that I can use "dir" shell cmd to list the files in a directory, but I CANNOT use dir to list the files inside a directory thats inside a directory? It works fine with ls on the current redhat server .... why not Windows?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users