thephpleague / flysystem-sftp

[READ-ONLY SUBSPLIT] Flysystem Adapter for SFTP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rename a directory

liveuser123 opened this issue · comments

Hi ,
How can I rename a Directory on the remote server.
In the api there is a method rename, but it is for files only and not for directories.

The rename method should work on this adapter for directories too since the api call is the same.

I tried with directory, It is throwing Exception
File not found at path: OldFolderName in /var/www/html/Project/vendor/league/flysystem/src/Filesystem.php:386 Stack trace: #0 /var/www/html/Project/vendor/league/flysystem/src/Filesystem.php(210): League\Flysystem\Filesystem->assertPresent('OldFolderNa...')

Then the directory you'r trying to rename is not located there. Have you set the root correctly? The has call internally just tries to fetch the metadata for the path, which doesn't care about wether it's a file or a directory.

Sorry to disturb you..
It was my fault. Root wasn't set correctly.
Thank you for your precious time and sorry once again.

These things happen 👍 glad you got it working on your end.

@liveuser123 I've used this interaction as an example of what issues I receive on this repo (what happened here happens a lot). If you see it, I don't mean it as a personal attack (I've blurred your username). I hope people can learn from it.