在 Mac 上查詢及設定檔的要求狀態Query and set Files On-Demand states on Mac

隨著 OneDrive 檔的要求,檔案可以是三種狀態的其中一種。With OneDrive Files On-Demand, files can be in one of three states. 這兩種狀態都會對應至檔案屬性狀態。Each of these states corresponds to a file attribute state. 若要查詢檔或資料夾目前的狀態,請使用下列命令:To query the current state of a file or folder, use the following command:

  • /Applications/OneDrive.App/Contents/MacOS/OneDrive /getpin <Path to file or folder>/Applications/OneDrive.App/Contents/MacOS/OneDrive /getpin <Path to file or folder>

腳本化命令Scriptable commands

使用下列命令來設定檔和資料夾狀態。Use the following commands to set file and folder states.

檔隨選狀態Files On-Demand state 檔案屬性狀態File attribute state CommandCommand
永遠可用Always available
寄託Pinned
/Applications/OneDrive.App/Contents/MacOS/OneDrive /setpin <path>/Applications/OneDrive.App/Contents/MacOS/OneDrive /setpin <path>
本機可用Locally available
ClearpinClearpin
/Applications/OneDrive.App/Contents/MacOS/OneDrive /clearpin <path>/Applications/OneDrive.App/Contents/MacOS/OneDrive /clearpin <path>
僅限線上Online-only
駐留Unpinned
/Applications/OneDrive.App/Contents/MacOS/OneDrive /unpin <path>/Applications/OneDrive.App/Contents/MacOS/OneDrive /unpin <path>

注意

若要設定資料夾中所有專案的檔案屬性狀態,請新增/r 參數。To set the file attribute state for all items within a folder, add the /r parameter.
固定僅限線上的檔案會讓同步應用程式下載檔案內容,而取消固定已下載的檔案會在本機儲存檔內容時,釋放裝置上的空間。Pinning an online-only file makes the sync app download the file contents, and unpinning a downloaded file frees up space on the device by not storing the file contents locally.
若要將僅限線上的檔案或資料夾設定為「本機可用」,您必須先將其設為「永遠可用」。To set an online-only file or folder to "locally available," you must first set it to "always available."