note 86168 deleted from function.rename by cmb
| From: | cmb@php.net | Date: | Sun, 22 Dec 2019 09:11:08 +0000 |
| Subject: | note 86168 deleted from function.rename by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213600@lists.php.net to get a copy of this message | ||
Note Submitter: garagod at gmail dot com
----
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