Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is_dir function

Status
Not open for further replies.

Creepy123

Programmer
Feb 3, 2005
3
GB
How can I check a dir like with the is_dir function and open it with the opendir function?

I have tried it but it doesn't work.

Do i need to take notice of something when I try to check and open an url.

Thanks!

My code
$handle = @opendir($dir);
while( $file = readdir($handle) ) {
if( is_dir("$dir/$file") )
$folders[] = $file;
elseif( is_file("$dir/$file") )
$files[] = $file;
}
@closedir($handle);
 
if u are using linux u can use wget to get check the existence of the file using bash script or there is a windows version of "wget" (i dont know much about the windows version though).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top