oss_file()

Read(222) Label: storage bucket,

Description:

Get the specified object in an OSS bucket.

Syntax:

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

Note:

External library function (See External Library Guide).

 

The returned file object supports file handling functions such as f.exists(), f.name(), f.size(), f.date(), f.read(), f.import() and f.export().

Parameter:

fd

OSS connection object

bucket

Bucket name

key

File name in the storage bucket

cs

Encoding name; use the encoding to save or open the file

Return value:

File object

Example:

 

A

 

1

=oss_open("LTAI5tRgzSpjU73Wt","4dNAtbcjF6arKp26JGaytM","http://oss-cn-beijing.aliyuncs.com")

 

2

=oss_file(A1, "unbucket101","emp.txt")

Load emp.txt in storage bucket unbucket101.

3

=A2.name()

Get the full path containing the file name.

4

=A2.import@t()

Return the file data as a table sequence.

5

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

Retrieve data in the way of cursor.

6

>oss_close(A1)

Close the OSS connection.