if symlink to an existing file, that needs to be removed before, done automaticaly now in sysmlink function

This commit is contained in:
Ralf Becker 2001-10-08 14:53:48 +00:00
parent dc20d2a54f
commit 79996d44dd

View File

@ -1277,11 +1277,11 @@
/*! /*!
@function cp @function cp
@abstract copy of symlink a file @abstract copy a file
@param $from from file/directory @param $from from file/directory
@param $to to file/directory @param $to to file/directory
@param $relatives Relativity array @param $relatives Relativity array
@symlink boolean True/False @symlink boolean True/False (only internal, use symlink function)
@result boolean True/False @result boolean True/False
*/ */
function cp ($from, $to, $relatives = '',$symlink=False) function cp ($from, $to, $relatives = '',$symlink=False)
@ -1309,6 +1309,10 @@
{ {
return False; return False;
} }
if ($cmd == 'symlink')
{
unlink($t->real_full_path); // else symlink does not work
}
} }
else else
{ {
@ -1431,6 +1435,8 @@
*/ */
function symlink($from,$to,$relatives = '') function symlink($from,$to,$relatives = '')
{ {
if ($this->file_exists ($to, array ($relatives[1])))
return $this->cp ($from, $to, $relatives, True); return $this->cp ($from, $to, $relatives, True);
} }