nurakantech
nurakantech

Reputation: 502

mkdir() throws warning message

What's the error in here?

 <?php
 define('TMP_FOLDER','temp'); 
 $temp_dir = $this->dir['root'].$this->config['sep'].TMP_FOLDER;

 //$temp_dir = C:\xampp\htdocs\xxx\temp
 //$this->dir['root'] = C:\xampp\htdocs\xxx

 if(!file_exists($temp_dir) && !is_dir($temp_dir)){
        chdir('../');
        mkdir(TMP_FOLDER, 0744);
    }
 ?>

This throws a warning like:-

Warning: mkdir(): File exists in C:\xampp\htdocs\xxx\yyy\display.php on line 49

I think this is an easy job. But, I can't understand what's this?

Upvotes: 0

Views: 609

Answers (2)

nurakantech
nurakantech

Reputation: 502

Found it, I removed the line

chdir('../');

changing the directory, directed to c:\xampp\htdocs. Removing this solved the problem.

Upvotes: 0

Jignesh Patel
Jignesh Patel

Reputation: 1022

remove below line and try

 chdir('../');

Upvotes: 1

Related Questions