note 98568 deleted from function.unlink by danbrown

From: Date: Fri, 25 Jun 2010 15:11:58 +0000
Subject: note 98568 deleted from function.unlink by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-170435@lists.php.net to get a copy of this message
Note Submitter: cabral dot brc at gmail dot com ---- My SO: Windows In an automatic process, I was trying to delete a file using <?php //(note the dot in the file's name.) unlink("C:/my/path/my.file.txt"); ?> and I was receiving "Invalid Argument". The problem was the dot... So, I thought I could use <?php rename("C:/my/path/my.file.txt","C:/my/path/myfile.txt"); ?> but again the "Invalid Argument". So, I had to use <?php exec("ren \"C:/my/path/my.file.txt\" \"myfile.txt\""); //the new name can't have the path unlink("C:/my/path/myfile.txt"); ?>

« previous php.notes (#170435) next »