Hi!
I have a problem communicating with MinIO
using R
in an optimal way.
The task is to list the available folders in a given subfolder located in the appropriate bucket.
Example:
A bucket named test_bucket
contains n
folders:
folder_1
,folder_2
,...
folder_n
Each of them contains some subfolders, for example folder_1
contains:
sub_folder_1.1
sub_folder_1.2
...
sub_folder_1.n
Similarly, the remaining folders.
How do I get a list of folders (without any subfolders!) from folder folder_2
?
I managed to do it in a rather primitive way, i.e. first I downloaded the entire contents of the bucket using the minio.s3::get_bucket_df
function and then filtered the paths accordingly and obtained the answer.
But this solution is ok, for buckets that do not contain much data, in a situation where it is very extensive with a lot of subfolders, it becomes very suboptimal, because we are unnecessarily searching through a huge area of data.
Is there a way to scan only the indicated folder and return its main content, i.e. the names of files and folders (without their contents) located in it?