RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 282 | Replies: 3 | Thread Tools  Display Modes
Reply
Join Date: Apr 2008
Location: Lahore, Pakistan
Posts: 44
Reputation: mustafaneguib is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
mustafaneguib mustafaneguib is offline Offline
Light Poster

directory functions not working

  #1  
Jul 20th, 2008
hey guys apparently directory functions such as opendir, and scandir are not working on my host.
following is the code, its from php.net.

the output is keep on coming fail.
is there something wrong with my php settings or something else.

the page is,

http://worldofpakistan.net/try/write.php

  1. <?php
  2.  
  3. $dir = "http://www.worldofpakistan.net/";
  4. $dh = scandir($dir);
  5. if($dh)
  6. {
  7. echo "success";
  8. }
  9. else
  10. {
  11. echo "fail";
  12. }
  13.  
  14. while (false !== ($filename = readdir($dh))) {
  15. $files[] = $filename;
  16. }
  17.  
  18. sort($files);
  19.  
  20. print_r($files);
  21.  
  22. rsort($files);
  23.  
  24. print_r($files);
  25.  
  26. ?>
Last edited by mustafaneguib : Jul 20th, 2008 at 8:40 pm.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2008
Location: Phoenix, AZ
Posts: 850
Reputation: R0bb0b is on a distinguished road 
Rep Power: 2
Solved Threads: 66
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: directory functions not working

  #2  
Jul 20th, 2008
replace 'echo "fail";'
with print_r(error_get_last());
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss

-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
Reply With Quote  
Join Date: Apr 2008
Location: Lahore, Pakistan
Posts: 44
Reputation: mustafaneguib is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
mustafaneguib mustafaneguib is offline Offline
Light Poster

Re: directory functions not working

  #3  
Jul 20th, 2008
im getting the following output:
Array ( [type] => 2 [message] => scandir() [function.scandir]: (errno 25): Inappropriate ioctl for device [file] => /home/worldofp/public_html/try/write.php [line] => 7 )

instead of the list of files and directories.
Reply With Quote  
Join Date: Jun 2008
Location: Phoenix, AZ
Posts: 850
Reputation: R0bb0b is on a distinguished road 
Rep Power: 2
Solved Threads: 66
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: directory functions not working

  #4  
Jul 21st, 2008
I've never seen that error and there's not much documentation on it so I would assume that it is a problem at the server level.
Last edited by R0bb0b : Jul 21st, 2008 at 1:58 am.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss

-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the PHP Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 8:49 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC