php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #12220 help
Submitted: 2001-07-18 01:17 UTC Modified: 2002-02-09 23:45 UTC
From: boo_d81 at hotmail dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.6 OS: windows 98
Private report: No CVE-ID: None
 [2001-07-18 01:17 UTC] boo_d81 at hotmail dot com
the problem is.... 
i want to check a directory ... 
09 <? chdir("d:/temp") 
10 $dir="username"; 
11 if(is_dir($dir)) 
12 { 
13 //code 
14 }else 
15 {mkdir($dir,0700);} ?> 
php return a error...NO SUCH DIRECTORY OR FILE ON LINE 11 ... 
my goals is to check is there a directory name "username" if there are not a directory name "username" i want to create it ..can anybody help me how i can solve this problem 


thanx before that...... 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-18 01:37 UTC] zak@php.net
Sorry! This is *not* a support forum.

Subscribe to the PHP General mailing list (php-general-subscribe@lists.php.net). 

Visit http://php.net/support.php for more information.
 [2001-07-18 10:27 UTC] cynic@php.net
Hartmut Holzgraefe:
you have to check for file existance with file_exists() before you
try to probe for its filetype


I think it'd be useful if the is_<type> functions in the FS category did that for the user, so moving to feature request.

I don't know enough about the underlying C stuff, but I don't think is_<type> checking the existence of the file/dir/whatever would be more expensive, would it?
 [2002-02-09 23:45 UTC] jimw@php.net
use @is_dir() if you don't want to see error messages.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 04:01:38 2024 UTC