s3_list()

Read(1515) Label: s3, list,

Description:

List file in the storage bucket or the specified bucket.

Syntax:

s3_list(fd,[bucket])

Note:

External library function (See External Library Guide).

 

The function lists files in S3 storage bucket or a specified storage bucket and returns a table sequence containing the files or certain properties of the storage bucket.

 

When all parameters are present, the function lists all files in the storage bucket bucket; and in this case in the returned table sequence, Key field represent the file name, Size field represents the file size whose unit is byte, and Date field represents the creation time or the last modified time of the current file.

 

When parameter bucket is absent, list all storage buckets on S3 platform; in the returned table sequence, Key represents the bucket name and Size field won’t be displayed.

Parameter:

fd

S3 connection object

bucket

Bucket name

Return value:

Table sequence

Example:

 

A

 

1

=s3_open("ASIAVSPDUYZ7O7WTX7C3":"7/5xYPO7a+9Po+IE1ySbmu9UB2hWIkWek1Sqn6E4":"us-east-2":"https://s3.us-east-2.amazonaws.com")

Connect to AWS S3.

2

=s3_list(A1, "test1")

Return a list of file names in storage bucket test1.

3

=s3_list(A1)

Return a list of storage buckets.

4

>s3_close(A1)

Close AWS S3 connection.