如何列出 Google Drive 文件夹的所有文件、文件夹、子文件夹和子文件 [英] How to list all files, folders, subfolders and subfiles of a Google drive folder

查看:71
本文介绍了如何列出 Google Drive 文件夹的所有文件、文件夹、子文件夹和子文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何想法如何在单个查询中查询所有孩子和孩子的孩子?

Any ideas how to query for all the children and the children of the children in a single query?

更新

这似乎是一个简单的问题.我怀疑是否有一个简单的解决方案?

It seems like a simple question. I doubt if there is a simple solution?

查询文件夹和文件树可能会花费大量 API 调用.因此,为了解决我的问题,我使用单个查询来列出所有者的所有文件和文件夹.此查询还返回子文件和子文件夹.要在列表中找到文件夹及其所有子文件夹(文件夹、文件、子文件夹和子文件),我必须创建一个类似索引的树.

Quering the tree of folders and files can cost a lot of API calls. So, to solve my problem, I use a single query to list all the files and folders of an owner. This query also returns subfiles and subfolders. To find the folder and all of its children (folder, files, subfolders and subfiles) in the list, I had to create a tree like index.

结论

单个查询是不够的.您必须列出所有或缩小与所有者的查询.接下来您必须索引结果以(递归)找到文件夹的树.

A single query is not enough. You have to list all or narrow the query with an owner. Next You have to index the results to (recursive) find the tree for the folder.

像 (ls -R in Unix) 这样的查询选项会很好.

A query option like (ls -R in Unix) would be nice.

推荐答案

我认为您在更新"中的想法是正确的.将 Drive 视为平面,调用列出所有内容,并从中生成您自己的树.

I think you have the right idea in your "update". Treat Drive as flat, make calls to list everything, and generate your own tree from that.

这篇关于如何列出 Google Drive 文件夹的所有文件、文件夹、子文件夹和子文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆