移动命令会移除文件原有的父文件夹关系
原文依据:3 处步骤 3 不只是把文件加入新文件夹,还会通过 `removeParents` 删除旧父文件夹关系。内容没有要求先核对文件、旧父文件夹和目标文件夹,也没有预览或逐项确认步骤。
如果占位 ID 被错误替换,真实的 Drive 文件可能从原位置消失、被放入错误项目结构,或因目标文件夹的共享设置而对不同人员可见。验证步骤只能列出目标文件夹内容,不能自动撤销错误移动。
这是实际执行步骤,不是示例警告;`removeParents` 会在把指定文件加入新文件夹的同时移除其旧父文件夹关系。该操作符合技能所声明的“移动文件”用途,因此不是用途外行为,但若 FILE_ID、FOLDER_ID 或 OLD_PARENT_ID 填错,文件会从原位置消失,且验证仅安排在变更之后。用户可要求执行前列出并逐项确认文件及新旧父文件夹,或先只添加新父文件夹而不移除旧关系。
2. Create sub-folders: `gws drive files create --json '{"name": "Documents", "mimeType": "application/vnd.google-apps.folder", "parents": ["PARENT_FOLDER_ID"]}'`3. Move existing files into folder: `gws drive files update --params '{"fileId": "FILE_ID", "addParents": "FOLDER_ID", "removeParents": "OLD_PARENT_ID"}'`4. Verify structure: `gws drive files list --params '{"q": "FOLDER_ID in parents"}' --format table`查看另外 2 个位置
3. Move existing files into folder: `gws drive files update --params '{"fileId": "FILE_ID", "addParents": "FOLDER_ID", "removeParents": "OLD_PARENT_ID"}'`4. Verify structure: `gws drive files list --params '{"q": "FOLDER_ID in parents"}' --format table`name: recipe-organize-drive-folderdescription: "Create a Google Drive folder structure and move files into the right locations."metadata: