-
Notifications
You must be signed in to change notification settings - Fork 831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FTP adapter and createDir with a dot folder #1006
Comments
Hi, I've tried to reproduce this but I'm getting an error trying to create the directory |
For now I'm going to close this issue because I think it's expected behaviour. If not, please comment with more information and we can re-open this issue. |
@frankdejonge Did you try it with different servers? The behavior might vary from server implementations I think. I can't agree with the "expected behaviour": a server can have dot folders, and handling dot files must not fail in a bizarre way. |
Regardless of what you think of it, I can't make a FTP server behave different, nor can I make the ftp_nlist function return dot prefixed directories. I also didn't see anything in the PHP docs about this described behaviour and I couldn't reproduce it with a standard implementation of FTP. I'm not going to just try all the FTP version out there, this is not my job. So unless you supply better information or supply a PR that proves it (preferably with a server in docker) this issue is not actionable for me. |
@frankdejonge I actually provided details on which servers I did and did not experience the issue! Also, since the current implementation of the directory creation (in createActualDirectory) of the ftp implementation of flysystem is really a very custom one, I'm wondering how this is even expected to work, that's why I'm submitting it as an issue, instead of a PR/rewrite of that code. Finally, managing the differences between server implementations is the job of an abstraction library like flysystem, and should make it work the same way regardless of the server used. So unless this issue is resolved, let's keep it open, as a solution could be provided and people experiencing this behavior will find it helpful if the issue is being shown as open/ongoing. |
This is an open source project. Submit a PR. Good luck. |
I will, if the issue is kept open. |
Bug Report
Summary
With the FTP adapter, it seems that creating a directory inside a dot directory doesn't work.
Server is pure-ftpd on ubuntu.
How to reproduce
I'm trying to create a directory inside a dot directory like this
->createDir('.dir1/dir2');
and it fails because in FTP's createActualDirectory method,$listing = ftp_nlist($connection, '.') ?: [];
returns only non-dot files and directories. So the createDir method thinks .dir1 doesn't exist, and tries to create it, which fails.It is a problem because it can break in a few other use cases: when a dot file with the same name as the directory exists for example, createActualDirectory will try to create the dot directory and fail too, with a non explicit error.
A few more information:
The text was updated successfully, but these errors were encountered: