s3_ file ()

Read(922) Label: s3, file,

Description:

Get the specified object from a bucket.

Syntax:

s3_file(fd,bucket,key[:cs])

Note:

External library function (See External Library Guide). It establishes association between the S3 object and a file object. Support file object-related functions, such as exists, name, size, date, read, import and export.

Parameter:

fd

S3 connection object

bucket

key

Bucket name

Target object name

cs

Character set used to save or open an object

Return value:

File object

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_file(A1, "test1","emp.txt")

Load a file object from bucket test1

3

=A2.name()

Get a full path containing the file name

4

=A2.exists()

Check if the target file exists

5

=A2.size()

Return size of the file

6

=A2.date()

Return date of modification of the file

7

=A2.read@nv()

Read content from the object

8

=A2.import@t()

Return file data as a table sequence

9

=A2.cursor@t().fetch(10)

Retrieve data in the form of cursor

10

=s3_close(A1)

Close AWS S3 connection