From 79996d44ddbaaa004a5cc74fa8536304b323e6ed Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 8 Oct 2001 14:53:48 +0000 Subject: [PATCH] if symlink to an existing file, that needs to be removed before, done automaticaly now in sysmlink function --- infolog/inc/class.vfs.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/infolog/inc/class.vfs.inc.php b/infolog/inc/class.vfs.inc.php index 726abbb59b..d70a69b349 100644 --- a/infolog/inc/class.vfs.inc.php +++ b/infolog/inc/class.vfs.inc.php @@ -1277,11 +1277,11 @@ /*! @function cp - @abstract copy of symlink a file + @abstract copy a file @param $from from file/directory @param $to to file/directory @param $relatives Relativity array - @symlink boolean True/False + @symlink boolean True/False (only internal, use symlink function) @result boolean True/False */ function cp ($from, $to, $relatives = '',$symlink=False) @@ -1309,6 +1309,10 @@ { return False; } + if ($cmd == 'symlink') + { + unlink($t->real_full_path); // else symlink does not work + } } else { @@ -1431,6 +1435,8 @@ */ function symlink($from,$to,$relatives = '') { + if ($this->file_exists ($to, array ($relatives[1]))) + return $this->cp ($from, $to, $relatives, True); }