如何获取根的大小&&已使用的根大小
How to get size of root && used size of root
我正在使用 Google PHP 客户端库来处理 Google Drive API。我正在尝试查找根目录的当前大小。
我的代码如下
$file = $this->service->files->get('root',array( 'fields'=>'size,spaces,quotaBytesUsed',));
Size 和 quotaBytesUsed 为 0;
size long The size of the file's
content in bytes. This is only
applicable to files with binary content in Drive.
quotaBytesUsed long The number of storage quota bytes used by the file
. This includes the head revision as well as previous revisions with keepForever enabled.
正如文档所述,只有文件包含大小。您将不得不按照我认为的困难方式进行操作,并获取 google 驱动器中所有文件的列表并将它们相加。
另一种方法是,如果您想获取有关 space 您在 google 驱动器上使用了多少的信息,您可以使用 About.get 方法,其中 returns space 对于用户 google 驱动器帐户
"storageQuota": {
"limit": "18253611008",
"usage": "12738688521",
"usageInDrive": "2449392360",
"usageInDriveTrash": "838401665"
}
我正在使用 Google PHP 客户端库来处理 Google Drive API。我正在尝试查找根目录的当前大小。
我的代码如下
$file = $this->service->files->get('root',array( 'fields'=>'size,spaces,quotaBytesUsed',));
Size 和 quotaBytesUsed 为 0;
size long The size of the
file's
content in bytes. This is only applicable to files with binary content in Drive.
quotaBytesUsed long The number of storage quota bytes used by thefile
. This includes the head revision as well as previous revisions with keepForever enabled.
正如文档所述,只有文件包含大小。您将不得不按照我认为的困难方式进行操作,并获取 google 驱动器中所有文件的列表并将它们相加。
另一种方法是,如果您想获取有关 space 您在 google 驱动器上使用了多少的信息,您可以使用 About.get 方法,其中 returns space 对于用户 google 驱动器帐户
"storageQuota": {
"limit": "18253611008",
"usage": "12738688521",
"usageInDrive": "2449392360",
"usageInDriveTrash": "838401665"
}