Qdirectory()

Read(1685) Label: cloud storage, prefix, delimiter,

Description:

Get a list of file names that match the specified remote storage path with wildcards.

Syntax:

Qdirectory(path)

Note:

The function gets a list of file names that match parameter path, the specified wildcard path, without including the path names. The query only limits within objects in the storage buckets.

 

When the parameter is absent or the parameter is written as "/", return a list of all storage buckets.

Parameter:

path

The wildcard path in a remote storage bucket (the format is storage bucket name/path/file name); search the file name according to the wildcard characters - * represents zero or multiple characters, and ? represents a single character.

Option:

@d

List the subdirectories of parameter path.

@p

Return files with full path names in the storage bucket file folder.

@m

Create a directory in a storage bucket.

@r

Delete directories, which should be empty, from a storage bucket.

@s

Search for names of files in all subdirectories recursively; the option does not work with @m and @r.

@c

Force to be case-insensitive; use system default when it is absent

Return value:

Sequence

Example:

Take S3 cloud storage as an example:

 

A

 

1

=Qdirectory()

 

Return all storage buckets.

2

=Qdirectory("test1")

Get files in the root directory of storage bucket test1.

3

=Qdirectory@s("test1")

 

Return a list of all files in root directory and the subdirectories of storage bucket test1.

4

=Qdirectory("test1/emp*.ctx")

Return a list of files whose suffixes are emp and extensions are .ctx in storage bucket test1.

 

5

=Qdirectory@d("test1/ctxs/")

List subdirectories in storage bucket test1.

6

=Qdirectory@p("test1/ctxs/")

Return files with full path names in storage bucket test1’s directory ctxs.

7

=Qdirectory@m("test1/sln/")

Create directory sln in storage bucket test1.

8

=Qdirectory@r("test1/sln/")

Delete directory sln from storage bucket test1.

9

=Qdirectory@s("test1/ctxs/")

Return a list of all files in storage bucket test1/ctxs directory and its subdirectories.

10

=Qdirectory@c("test1/CTXS/*.ctx")

Force to be case-insensitive, and list ctx files in storage bucket test1.