Skip to main content

getpath

汇总

获取云中目录条目的文件路径及其他文件属性。

讨论

注:

此类无法直接实例化。 由 AIODirEntry 对象的 cloud 属性返回此类的实例。

语法

getpath()

方法

getpath({type})

获取 CloudPathType 格式的条目绝对路径。

名称 说明 数据类型

type

(可选)

Specifies the path style that will be used for the returned URI (for cloud only). The data type is CloudPathType.

Use the following options from the CloudPathType enumeration: CloudPathType.VSI, CloudPathType.ACS, CloudPathType.HTTP, and CloudPathType.CLOUDSTORES.

(默认值为 CloudPathType.VSI)

Object

返回值

数据类型 说明

String

type 参数指定的格式返回路径。

from arcpy import CloudPathType
cloud_io = AIO(r"C:\data\datacloud.acs")
for item in cloud_io.scandir(r'list', depth=0):
    print(item.cloud.getpath(CloudPathType.ACS))

getvsipath()

获取 VSI 格式的条目绝对路径。

返回值

数据类型 说明

String

返回绝对 VSI 路径。

cloud_io = AIO(r"C:\data\datacloud.acs")
for item in cloud_io.scandir(r'list', depth=0):
    print(item.cloud.getvsipath())