downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ssh2_sftp_rmdir> <ssh2_sftp_realpath
[edit] Last updated: Fri, 25 May 2012

view this page in

ssh2_sftp_rename

(PECL ssh2 >= 0.9.0)

ssh2_sftp_renameRenomme un fichier distant

Description

bool ssh2_sftp_rename ( resource $sftp , string $from , string $to )

Renomme un fichier distant.

Liste de paramètres

sftp

Une ressource SSH2 SFTP, ouverte par la fonction ssh2_sftp().

from

Le fichier courant à renommer.

to

Le nouveau nom du fichier.

Valeurs de retour

Cette fonction retourne TRUE en cas de succès ou FALSE si une erreur survient.

Exemples

Exemple #1 Renommer un fichier via sftp

<?php
$connection 
ssh2_connect('shell.example.com'22);
ssh2_auth_password($connection'username''password');
$sftp ssh2_sftp($connection);

ssh2_sftp_rename($sftp'/home/username/oldname''/home/username/newname');
?>

Voir aussi

  • rename() - Renomme un fichier ou un dossier



add a note add a note User Contributed Notes ssh2_sftp_rename
thomas dot hebinck at digionline dot de 10-Nov-2011 09:57
An already existing file will NOT be overwritten.

http://www.openssh.com/txt/draft-ietf-secsh-filexfer-02.txt

"It is an error if there already exists a file with the name specified by newpath."

 
show source | credits | sitemap | contact | advertising | mirror sites