如何获得root&&的大小使用了root的大小

时间:2017-02-09 08:49:38

标签: php google-api google-drive-api google-api-php-client

我正在使用Google PHP客户端库处理Google Drive API。我试图找到根目录的当前大小。

我的代码如下。

>>> x = True
>>> x
True

>>> x = not x
>>> x
False

>>> x = not x
>>> x
True

尺寸和quotaBytesUsed为0;

1 个答案:

答案 0 :(得分:1)

File resource documentation

  

尺寸 file's 内容的大小(以字节为单位)。这只是   适用于Drive中具有二进制内容的文件。

   quotaBytesUsed long file 使用的存储配额字节数。这包括头版本以及启用了keepForever的先前版本。

正如文档所述,只有文件包含大小。你必须以我认为的方式去做,并获得谷歌驱动器中所有文件的列表并添加它们。

如果您尝试获取有关在Google云端硬盘上使用了多少空间的信息,则可以使用About.get方法为用户google云端硬盘帐户返回空间

"storageQuota": {
  "limit": "18253611008",
  "usage": "12738688521",
  "usageInDrive": "2449392360",
  "usageInDriveTrash": "838401665"
   }