Skip to content

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

Open
@pfleu

Description

@pfleu

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)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions