Jump to content

exec ("dir") problem on WinXP


cadams7407

Recommended Posts

PHP 4.3.11 on WinXP Pro 32bit

I am using [code]exec("dir pictures/$input /b/x",$pic);[/code] 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 [code]exec("dir $input /b/x",$pic);[/code] 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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.