Problem with unlink() in php!

Posted by Holicreature on Stack Overflow See other posts from Stack Overflow or by Holicreature
Published on 2010-04-16T06:15:56Z Indexed on 2010/04/16 6:23 UTC
Read the original article Hit count: 159

Filed under:
|

I'm creating a temp image always named 1.png under specific folder and once i read the image_contents and process, i use unlink() to delete that specific image from that folder.

But sometimes the image file is not deleted and the same image is file is read and processed.

That script is working otherwise fine...

There is no permission related issues , as the files are deleted sometimes...

Will there be any issue when the script is repeatedly called and the image with the name is already present and not deleted etc.. ???

Please suggest me what would be the problem

      extension_loaded('ffmpeg');
      $max_width  = 120;
      $max_height = 72;
        $path ="/home/fff99/public_html/temp/";
            .....
            .....
        $nname = "/home/friend99/public_html/temp/".$imgname;
        $fileo = fopen($nname,"rb");
        if($fileo)
        {
            $imgData = addslashes(file_get_contents($nname));
                    ....
                    ...
                    ..
        }
        unlink('$nname');

© Stack Overflow or respective owner

Related posts about php

Related posts about files