Skip to content
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

How to get list of files in current dir not subdirs using different adapters ? #265

Open
pfleu opened this issue Apr 27, 2022 · 0 comments
Assignees

Comments

@pfleu
Copy link

pfleu commented Apr 27, 2022

Hello, using Gaufrette v0.4.0,
I have a Filesystem created from either a Local Adapter or a FtpAdapter.
I need to list files inside current dir (not files inside subdirs)
Is there a way working for both cases ?

$fileSystem->listKeys()['keys'] works with LocalAdapter but returns keys inside subdirs when used with FtpAdapter

$filesystem->getAdapter()->listDirectory()['keys'] works with FTPAdapter but the method listDirectory() is not implemented in Local adpater.

EDIT
I just noticed that behaviour with PhpseclibSftp Adapter is the same as Local Adapter, i.e. the files inside the children directories are not listed twice. So IMHO, the behaviour for Ftp Adapter is a bug or is seriously misleading (a file inside a child dir will be listed twice, once as "file.ext" and another time as subdir/file.ext)

@pfleu pfleu changed the title How to get list of files in current dir not children dirs using different adapters ? How to get list of files in current dir not subdirs using different adapters ? Apr 28, 2022
@PedroTroller PedroTroller self-assigned this Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants