[0.1.13] Access MKDIR only works 1st time if UNLINK disabled

Want to share what MODs you've gotten to work with EM? Happy about all the time your're saving? Want to say "thanks"? Here's the place.
Forum rules
DO NOT give out any FTP passwords to anyone! There is no reason to do so! If you need help badly enough, create a temporary FTP account that is restricted to only the files that you need help with and give the information for that. Giving out FTP information can be very dangerous!
Locked
HSorgYves
Registered User
Posts: 4
Joined: Wed May 04, 2005 9:28 pm
Location: Luxembourg
Contact:

[0.1.13] Access MKDIR only works 1st time if UNLINK disabled

Post by HSorgYves » Wed May 18, 2005 10:18 pm

Code: Select all

function check_access_mkdir( &$access_msg)
{
	global $lang ;

	// check for server mkdir access
	if ( mkdir( 'EM_test_dir', 0777))
	{
		// clean up!
		rmdir( 'EM_test_dir') ;

		$access_msg = 'OK' ;
		return true ;
	}
	else
	{
		$access_msg = $lang['EM_failed'] ;
		return false ;
	}
}
The function (in easymod_display_functions.php) tries to clean up the directory that was temporarly created. However if the directory cannot be unlinked, it will exist during the next test cyclus and always return false.

Locked