Re: Re: PHP 4.0.3RC1

From: Date: Mon, 02 Oct 2000 22:42:33 +0000
Subject: Re: Re: PHP 4.0.3RC1
References: 1  Groups: php.dev php.qa 
Request: Send a blank email to php-dev+get-34114@lists.php.net to get a copy of this message
> > Do you have any idea what the problem is? What is the difference between > > the two unlink()'s? > > I remember unlink did not work for a while on win32 and according to > this note in the manual "Note: This function may not work on Windows > systems." there is a difference, did not review the source though... > > Was not that the same case as with rename()? Some system > calls are prefixed with "_" on Win32 which also affected > the entries in the PHP function table. windows defines unlink as well as _unlink. it seems like the file save handler is not closing it's handles, therefore the file is open and windows refuses to delete it. <? session_id(md5(microtime())); $id = session_id(); session_start(); session_destroy(); if( unlink(session_save_path()."/sess_$id") ) print "deleted session $id\n<br>"; session_id(md5(microtime())); session_start(); $id = session_id(); /* session_destroy(); */ if( unlink(session_save_path()."/sess_$id") ) print "deleted session $id\n<br>"; ?> produces: deleted session b3398a67397a507e5a2ef178693adcbd Warning: Unlink failed (Permission denied) in session.php on line 16 greetings daniel /*-- daniel beulshausen - daniel@php4win.de using php on windows? http://www.php4win.de

« previous php.dev (#34114) next »