note 86167 modified in function.unlink by felipe

From: Date: Tue, 07 Oct 2008 19:57:09 +0000
Subject: note 86167 modified in function.unlink by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-145140@lists.php.net to get a copy of this message
When I'm using unlink() or rename() with a SSH2.SFTP wrapper, both functions always return FALSE (but without a warning) even on success. Example: <?php $connection = ssh2_connect(SERVER_NAME, PORT); ssh2_auth_password($connection, USERNAME, PASSWORD); $sftp = ssh2_sftp($connection); unlink("ssh2.sftp://$sftp/" . REMOTE_DIRECTORY . FILENAME); // returns FALSE on success and on failure rename("ssh2.sftp://$sftp/" . REMOTE_DIRECTORY . OLD_FILENAME, "ssh2.sftp://$sftp/" . REMOTE_DIRECTORY . NEW_FILENAME); // returns FALSE on success and on failure ?> --was-- When I'm using unlink() or rename() with a SSH2.SFTP wrapper, both functions always return FALSE (but without a warning) even on success. Example: $connection = ssh2_connect(SERVER_NAME, PORT); ssh2_auth_password($connection, USERNAME, PASSWORD); $sftp = ssh2_sftp($connection); unlink("ssh2.sftp://$sftp/" . REMOTE_DIRECTORY . FILENAME); // returns FALSE on success and on failure rename("ssh2.sftp://$sftp/" . REMOTE_DIRECTORY . OLD_FILENAME, "ssh2.sftp://$sftp/" . REMOTE_DIRECTORY . NEW_FILENAME); // returns FALSE on success and on failure http://php.net/manual/en/function.unlink.php

« previous php.notes (#145140) next »